B
Bill Cunningham
Would getc and ungetc be the best and most simple what to parse
expressions for a parser?
Bill
expressions for a parser?
Bill
Would getc and ungetc be the best and most simple what to parse
expressions for a parser?
It depends on your parser design.Trent Buck said:ungetc can't be applied more than once `in a row' (i.e. sequentially).
I suspect that makes for a rather unsuitable function for a parser.
I have k&r 2. What about redirecting fgetc to stdio and using it insteatSM Ryan said:# Of course if you have ambitions to build a natural language parser, or even
# some simple grammars with unusual characteristics, then this scheme won't
# work, and you will need some method of scanning up and down many tokens on
# input.
Such a parser runs the risk of exponential running time, while a tabular
parser doesn't need to back up and has cubic time worst case. ungetc has
at most marginal usability for some types of lexical scanners.
Bill Cunningham said:tokens
I have k&r 2. What about redirecting fgetc to stdio and using it insteat
getc?
Bill
Would getc and ungetc be the best and most simple what to parse
expressions for a parser?
What is important in terms of the tokenizer is that they be left-right withBill Cunningham said:I've heard of top down recursive parsers.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.