Weiler-Thiessen, David, SASKATOON, Engineering wrote:
Don't deal with it in the parser, use a lexer rule for single quotes, then either use the trick below or just set the text of the token ( $text = $text.substring( ... etc) to remove the quotes. It is returning the quotes in your tree parser because you are asking for the text of the subtree, which includes the SINGLE_QUOTE tokens. STRING_LITERAL @init { int theStart = $start; } : '\'' { // Start the token text here, when we don't want the opening ' // theStart = getCharIndex(); } ~'\''* { $start = theStart; emit(); } '\'' ; Jim --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~--- |
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
