I'm trying to write a parser when the syntax is generally whitespace delimited tokens; however, in certain contexts, the whitespace is significant; examples such as quoted strings, but I also have instances where a block is delimited by the tokens:
action ... {
/* start of whitespace significant block
* where we read everything until the closing brace
*/
}
Would I perhaps need two tokenizers? One that basically looks for these special conditions, and then another that feeds these in and generates a more specific token stream?
Am trying to rewrite a parser using yacc, and it has three "parsing modes" in what appears to be a character-by-character scanning function.
I'm trying to write a parser when the syntax is generally whitespace delimited tokens; however, in certain contexts, the whitespace is significant; examples such as quoted strings, but I also have instances where a block is delimited by the tokens:
Would I perhaps need two tokenizers? One that basically looks for these special conditions, and then another that feeds these in and generates a more specific token stream?
Am trying to rewrite a parser using
yacc, and it has three "parsing modes" in what appears to be a character-by-character scanning function.