GOLD is a grammar language created in 2012.
#1615on PLDB | 12Years Old |
GOLD is a free parsing system that is designed to support multiple programming languages.. Read more on Wikipedia...
<Statement> ::= if <Expression> then <Statements> end
| while <Expression> do <Statements> end
| for Id = <Range> do <Statements> end
<Statements> ::= <Statements> <Statement>
| <Statement>
<Statement> ::= display <Expression>
| display <Expression> read ID
| assign ID '=' <Expression>
| while <Expression> do <Statements> end
| if <Expression> then <Statements> end
| if <Expression> then <Statements> else <Statements> end
<Expression> ::= <Expression> '>' <Add Exp>
| <Expression> '<' <Add Exp>
| <Expression> '<=' <Add Exp>
| <Expression> '>=' <Add Exp>
| <Expression> '==' <Add Exp>
| <Expression> '<>' <Add Exp>
| <Add Exp>
<Add Exp> ::= <Add Exp> '+' <Mult Exp>
| <Add Exp> '-' <Mult Exp>
| <Add Exp> '&' <Mult Exp>
| <Mult Exp>
<Mult Exp> ::= <Mult Exp> '*' <Negate Exp>
| <Mult Exp> '/' <Negate Exp>
| <Negate Exp>
<Negate Exp> ::= '-' <Value>
| <Value>
<Value> ::= Identifier
| StringLiteral
| NumberLiteral
| '(' <Expression> ')'