symb2id {xegaBNF} | R Documentation |
symb2id()
converts a symbol to a numeric id.
symb2id(sym, ST)
sym |
A character string with the symbol, e.g. <fe> or "NOT". |
ST |
A symbol table. |
A positive integer if the symbol exists or
an empty integer (integer(0)
)
if the symbol does not exist.
Other Utility Functions:
derive()
,
id2symb()
,
isNonTerminal()
,
isTerminal()
,
rules()
g<-compileBNF(booleanGrammar())
symb2id("<fe>", g$ST)
symb2id("NOT", g$ST)
symb2id("<fe", g$ST)
symb2id("NO", g$ST)
identical(symb2id("NO", g$ST), integer(0))