Loading ...
Sorry, an error occurred while loading the content.

Lexical State ?

Expand Messages
  • John
    While I am at it- could any refer me to a good reference on how to use Lexical States in ANTLR. I am trying to define rules such as anything_but_semi to help
    Message 1 of 1 , Sep 1, 2000
    • 0 Attachment
      While I am at it- could any refer me to a good reference on how to
      use Lexical States in ANTLR. I am trying to define rules such as
      anything_but_semi to help parse a semi-delimited list. I have no way
      of knowing what exists between the delimiters in advance. When I
      tried various approaches it seemed that ANTLR would match a specific
      token, for example, ALPHANUMERIC_TEXT when I really wanted to
      consume until I hit a semi.

      The only way I could get it to work is by listing all of the possible
      tokens (e.g. ALPHA | CHAR | NUMERIC | PERIOD, ... ) that I have
      defined in the lexer EXCEPT the one that I am 'keying on' in a parser
      rule. It seems to be very repetitive. I tried ANYTHING_BUT_SEMI in
      the lexer but it didn't seem to work for the above reason.

      Thanks in advance for any comments.

      John
    Your message has been successfully submitted and would be delivered to recipients shortly.