Difference between revisions of "SCI/Specifications/SCI in action/Parser"

Jump to navigation Jump to search
Merging of the SCI documentation. Work in progress. Formatting needs improving.
(Merging of the SCI documentation. Work in progress)
(Merging of the SCI documentation. Work in progress. Formatting needs improving.)
Line 173: Line 173:


For the following sections, we define
For the following sections, we define
* group <i>W &rarr; &Gamma;.group : (&gamma;,&mu;) (&gamma;,&mu;) &#8614; &gamma;</i>
* classes: <i>W &rarr; C</i>.classes: (&gamma;,&mu;) &#8614; &mu;
* <i>C<sub>x</sub> = {&omega;|&omega; &isin; class(&omega;)}
To do that, it uses the class masks <i>M</i> as input for a pushdown automaton (PDA) A built from a parser grammar; if <i>M</i> was accepted by <i>A</i>, the parse tree <i>T</i><sub>&pi;</sub> will be built from the matching syntax tree to represent the semantics.
The PDA is defined by a grammar <i>G = (V,&Sigma;,P,s)</i> most of which, along with its semantics, is stored in <tt>vocab.900</tt>. This resource contains a parser rule at every 20 bytes, starting with a non-terminal symbol &upsilon; (one word) and a null-terminated list of up to five tuples <i>&sigma;<sub>i</sub>,m<sub>i</sub></i> , both of which are words. In these tuples, <i>m<sub>i</sub></i> is a terminal or non-terminal symbol (determined by <i>&sigma;<sub>i</sub></i> ), and <i>&sigma;<sub>i</sub></i> is the meaning of <i>m<sub>i</sub></i> :
{| border="1"
|<i>&sigma;<sub>i</sub></i>
|Type
|Meaning
|----
|0x141
|Non-terminal
|Predicate part: his identifies the first part of a sentence
|----
|0x142
|Non-terminal
|Subject part: This identifies the second part of a sentence
|----
|0x143
|Non-terminal
|Suffix part: This identifies the third and last part of a sentence
|----
|0x144
|Non-terminal
|Reference part: This identifies words that reference another word in the same sentence part
|----
|0x146
|Terminal
|Match on class mask: Matches if {{nowrap begin}}<i>m<sub>i</sub> &isin; classes(&omega;<sub>j</sub>)</i>{{nowrap end}}
|----
|0x14d
|Terminal
|Match on word group: Matches if {{nowrap begin}}<i>m<sub>i</sub> &#61; group(&omega;<sub>j</sub>)</i>{{nowrap end}}
|----
|0x154
|Terminal
|"Force storage": Apparently, this was only used for debugging
|----
|}
245

edits

Navigation menu