As I am new to lezer generator and getting few warnings. Attaching the code below
@top BuilderExpression { Expression }
@tokens {
ComparisonOperator { ">" | "<" | ">=" | "<=" | "==" | "=" | "!=" }
PlusMinus { "+" | "-" }
StarObelus { "*" | "/" }
NotQuoteChar { !["] }
String { "\"" NotQuoteChar* "\"" }
Digit { '0' | $[1-9] }
TransformerName { "min_max_scaler" | "standard_scale" }
FunctionName { "if" | "and" | "or" | "not" | "rename" | "toUppercase" | "toLowercase" | "trim" | "contains" | "indexOf" | "lastIndexOf" | "replace" | "length" | "match" }
Space { " " }
Round { "(" | ")" }
}
Expression {
Expression "or" Comparison
| Comparison
}
Comparison {
Comparison ComparisonOperator Item
| Item
}
TimesDivide {
TimesDivide SpaceFactor StarObelus SpaceFactor Factor |
Factor
}
SpaceFactor {
Item Space Item | AddSubtract "(" Expression ")"
}
AddSubtract {
Item PlusMinus Term | RoundTerm "(" Expression ")"
}
RoundTerm {
Item Round Term
}
Item {
Item PlusMinus Term
| Term
}
Term {
Term StarObelus Factor
| Factor
}
Factor {
Value
| Parentheses
}
Parentheses {
"(" Expression ")"
}
Value {
DataFrame
| Column
| Function
| String
| Number
| Bool
}
Function {
Transformer
| RegularFunction
}
Transformer {
TransformerName "(" Expression ("," Expression)* ")"
}
RegularFunction {
FunctionName "(" Expression ("," Expression)* ")"
}
DataFrame {
"[" String "," String "," String* "]"
}
Column {
"[" String "]"
}
Number {
Float
| Integer
}
Bool {
"true"
| "false"
}
Float {
Integer "." Integer
}
Integer {
Digit+
}
@detectDelim
And the warnings while generating the parser are:
Unused rule 'Space' (src/my.grammar 12:2)
Unused rule 'Round' (src/my.grammar 13:2)
Unused rule 'TimesDivide' (src/my.grammar 26:0)
Unused rule 'SpaceFactor' (src/my.grammar 31:0)
Unused rule 'AddSubtract' (src/my.grammar 35:0)
Unused rule 'RoundTerm' (src/my.grammar 39:0)
please help me to resolve these.