dcsimg
How can I extend CharScanner ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   John_Clarke
Posted On:   Friday, June 28, 2002 04:24 PM

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 test of the code ]]>]]> it said : 'xception: antlr.To   More>>
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




it said
:

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

found '

I would be grateful for all advice
offered

Thanks

John

   <<Less

Re: How can I extend CharScanner ?

Posted By:   Jeffrey_Law  
Posted On:   Thursday, July 4, 2002 10:44 AM

i think your '>' should be in single quote rather than double quote
About | Sitemap | Contact