symb2id {xegaBNF} | R Documentation |
Convert a symbol to a numeric identifier.
Description
symb2id()
converts a symbol to a numeric id.
Usage
symb2id(sym, ST)
Arguments
sym |
A character string with the symbol, e.g. <fe> or "NOT". |
ST |
A symbol table. |
Value
A positive integer if the symbol exists or
an empty integer (
integer(0)
) if the symbol does not exist.
See Also
Other Utility Functions:
derive()
,
id2symb()
,
isNonTerminal()
,
isTerminal()
,
rules()
Examples
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))
[Package xegaBNF version 1.0.0.0 Index]