[antlr-interest] beginner question

mzukowski at yci.com mzukowski at yci.com
Thu Apr 3 08:11:43 PST 2003


Sure, it's possible.  Take a look at the java.g grammar and copy its
COMMENT, STRING, WHITESPACE(might be called WS) and ID lexer rules.  Then
modify ID to allow the other characters you want to have in your text (like
'-').

Then ask more questions because you'll need to treat '/' alone specially but
it sounds like you're not quite ready for the details for that.

Also read the Ter's recent lectures.

Monty

-----Original Message-----
From: dk0879 [mailto:diver7 at mail.ru]
Sent: Thursday, April 03, 2003 1:11 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] beginner question



  Can somebody explain to me is it possible to write
  simple grammar to parse content like this:

  ---
  /* any symbols - comments */

  any symbols except comments open tag '/*' - program text

  /* any symbols - comments */

  any symbols except comments open tag '/*' - program text

  ...
  ---
  
  without detail defining grammar for a comments or a
  program text?


 

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


 

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




More information about the antlr-interest mailing list