parsodusparser.pds added
This commit is contained in:
parent
818386de56
commit
d2b106e6e5
|
@ -0,0 +1,66 @@
|
|||
parser: SLR(1)
|
||||
lexesis: parsodusLexer.lxs
|
||||
terminals:
|
||||
"PARSER"
|
||||
"PRECEDENCE"
|
||||
"LEXESIS"
|
||||
"TERMINALS"
|
||||
"START"
|
||||
"GRAMMAR"
|
||||
"PARSERTYPE"
|
||||
"LEFT"
|
||||
"RIGHT"
|
||||
"NONASSOC"
|
||||
"LEXESISNAME"
|
||||
"TERMINAL"
|
||||
"VARIABLE"
|
||||
"ARROW"
|
||||
"SEMICOLON"
|
||||
"COLON"
|
||||
"PIPE"
|
||||
"RULENAME"
|
||||
|
||||
start:
|
||||
<sections>
|
||||
|
||||
grammar:
|
||||
<sections> ::= <section> <sections>;
|
||||
<section> ::= "PARSER" "COLON" "PARSERTYPE"
|
||||
| "LEXESIS" "COLON" "LEXESISNAME"
|
||||
| "TERMINALS" "COLON" <terminals>
|
||||
| "PRECEDENCE" "COLON" <precedences>
|
||||
| "START" "COLON" "TERMINAL"
|
||||
| "GRAMMAR" "COLON" <rules>
|
||||
;
|
||||
|
||||
<terminals> ::= "TERMINAL" <terminals>
|
||||
|
|
||||
;
|
||||
|
||||
<precedences> ::= <precedence> <terminals> <precedences>
|
||||
| <precedence> <terminals>
|
||||
;
|
||||
|
||||
<precedence> ::= "LEFT"
|
||||
| "RIGHT"
|
||||
| "NONASSOC"
|
||||
;
|
||||
|
||||
<rules> ::= <rule> <rules>
|
||||
| <rule>
|
||||
;
|
||||
|
||||
<rule> ::= "VARIABLE" "ARROW" <bodies> "SEMICOLON";
|
||||
|
||||
<bodies> ::= <body> "PIPE" <bodies>
|
||||
| <body>
|
||||
;
|
||||
|
||||
<body> ::= <term_var> "RULENAME"
|
||||
| <term_var>
|
||||
;
|
||||
|
||||
<term_var> ::= <term_var> "VARIABLE"
|
||||
| <term_var> "TERMINAL"
|
||||
|
|
||||
;
|
Loading…
Reference in New Issue