[Feature] 写完了 打死不改了
This commit is contained in:
@@ -3,17 +3,25 @@
|
||||
}
|
||||
|
||||
StatementList {
|
||||
Statement*
|
||||
LBrace Statement* RBrace
|
||||
}
|
||||
|
||||
@skip { Whitespace }
|
||||
|
||||
IfStatement {
|
||||
If LParen ConditionalExpression RParen PartIfStatement Else Statement | If LParen ConditionalExpression RParen Statement
|
||||
If ConditionPart PartIfStatement Else Statement | If ConditionPart Statement
|
||||
}
|
||||
|
||||
PartIfStatement {
|
||||
If LParen ConditionalExpression RParen PartIfStatement Else PartIfStatement | NoIfStatement
|
||||
If ConditionPart PartIfStatement Else PartIfStatement | NoIfStatement
|
||||
}
|
||||
|
||||
ConditionPart {
|
||||
LParen Condition RParen
|
||||
}
|
||||
|
||||
Condition {
|
||||
ConditionalExpression (LogicalOperator ConditionalExpression)*
|
||||
}
|
||||
|
||||
ConditionalExpression {
|
||||
@@ -45,7 +53,7 @@ ConstantDefinition {
|
||||
}
|
||||
|
||||
VariableDefinition {
|
||||
Type (Identifier | AssignmentStatement)+ (Comma Identifier | Comma AssignmentStatement)*
|
||||
Type (Identifier | AssignmentStatement) (Comma Identifier | Comma AssignmentStatement)*
|
||||
}
|
||||
|
||||
Type {
|
||||
@@ -69,7 +77,11 @@ Number {
|
||||
}
|
||||
|
||||
Operator {
|
||||
EuqalTo | NotEqualTo | LessThan | GreaterThan | LessThanOrEqual | GreaterThanOrEqual
|
||||
EqualTo | NotEqualTo | LessThan | GreaterThan | LessThanOrEqual | GreaterThanOrEqual
|
||||
}
|
||||
|
||||
LogicalOperator {
|
||||
And | Or
|
||||
}
|
||||
|
||||
@tokens {
|
||||
@@ -93,7 +105,7 @@ Operator {
|
||||
UnsignedNumber { $[0-9]+ }
|
||||
String { "\"" $[\x00-\x7F]* "\"" }
|
||||
Character { "'" $[\x00-\x7F] "'" }
|
||||
EuqalTo { "==" }
|
||||
EqualTo { "==" }
|
||||
NotEqualTo { "!=" }
|
||||
LessThan { "<" }
|
||||
GreaterThan { ">" }
|
||||
@@ -101,4 +113,6 @@ Operator {
|
||||
GreaterThanOrEqual { ">=" }
|
||||
Equal { "=" }
|
||||
Whitespace { $[\t\n\r]+ }
|
||||
And { "&&" }
|
||||
Or { "||" }
|
||||
}
|
||||
Reference in New Issue
Block a user