Skip to content

Commit

Permalink
fix left recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
TommYDeeee committed Jan 29, 2024
1 parent 77d208d commit 528b1f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions yara_subset.grammar
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ RULEBODY -> STRINGS CONDITION | CONDITION .
STRINGS -> string colon STRINGSBODY.
CONDITION -> condition colon EXPRESSION.
STRINGSBODY -> variable assign string STRINGSBODY | eps.
EXPRESSION -> EXPRESSION OPERATOR EXPRESSION | NOTOPERATOR EXPRESSION | LITERAL.
EXPRESSION -> LITERAL EXPRESSION_2 | NOTOPERATOR EXPRESSION.
EXPRESSION_2 -> OPERATOR EXPRESSION EXPRESSION_2 | eps.
LITERAL -> variable | BOOLEAN.
BOOLEAN -> true | false.
OPERATOR -> and | or.
NOTOPERATOR -> not.

// https://smlweb.cpsc.ucalgary.ca/vital-stats.php?grammar=SOURCE+-%3E+RULE+%7C+eps.%0D%0ARULE+-%3E+rule+identifier+lbrace+RULEBODY+rbrace.%0D%0ARULEBODY+-%3E+STRINGS+CONDITION+%7C+CONDITION+.%0D%0ASTRINGS+-%3E+string+colon+STRINGSBODY.%0D%0ACONDITION+-%3E+condition+colon+EXPRESSION.%0D%0ASTRINGSBODY+-%3E+variable+assign+string+STRINGSBODY+%7C+eps.%0D%0AEXPRESSION+-%3E+EXPRESSION+OPERATOR+EXPRESSION+%7C+NOTOPERATOR+EXPRESSION+%7C+LITERAL.%0D%0ALITERAL+-%3E+variable+%7C+BOOLEAN.%0D%0ABOOLEAN+-%3E+true+%7C+false.%0D%0AOPERATOR+-%3E+and+%7C+or.%0D%0ANOTOPERATOR+-%3E+not.
// https://smlweb.cpsc.ucalgary.ca/vital-stats.php?grammar=SOURCE+-%3E+RULE+%7C+eps.%0D%0ARULE+-%3E+rule+identifier+lbrace+RULEBODY+rbrace.%0D%0ARULEBODY+-%3E+STRINGS+CONDITION+%7C+CONDITION+.%0D%0ASTRINGS+-%3E+string+colon+STRINGSBODY.%0D%0ACONDITION+-%3E+condition+colon+EXPRESSION.%0D%0ASTRINGSBODY+-%3E+variable+assign+string+STRINGSBODY+%7C+eps.%0D%0AEXPRESSION+-%3E+LITERAL+EXPRESSION_2+%7C+NOTOPERATOR+EXPRESSION.%0D%0AEXPRESSION_2+-%3E+OPERATOR+EXPRESSION+EXPRESSION_2+%7C+eps.%0D%0ALITERAL+-%3E+variable+%7C+BOOLEAN.%0D%0ABOOLEAN+-%3E+true+%7C+false.%0D%0AOPERATOR+-%3E+and+%7C+or.%0D%0ANOTOPERATOR+-%3E+not.

0 comments on commit 528b1f5

Please sign in to comment.