[antlr-interest] How can I extend CharScanner ?

johnclarke72 johnclarke at hotmail.com
Thu Jun 27 16:00:00 PDT 2002


Is there anywhere I can find an example of how to use the CharScanner 
class ?  If so where ?

In my Grammar I defined an item called data in my lexer :

DATA : (options {greedy=false;} : .)* "</"! ( 'a'..'z' )+ ">"!
                {selector.pop();}
                ;

I added it to my Parser :

// The Parser Rules
processHTML:
   data:DATA
   {
      // Add the Data to the Hash Table
      attributeData.put("DATA", data.getText());
   };

When I ran the following through it 

<script>
  test of the code
</script>

it said :

'xception: antlr.TokenStreamRecognitionException: expecting '<', 
found '

I would be grateful for all advice offered

Thanks

John



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list