Steve Ebersole
Steve Ebersole

Reputation: 9443

Cannot understand Antlr tool error parsing grammar

// Parser
statement
    : DELIMITER* statementPart+ DELIMITER* (EOL { newline(); })?
    ;

// Lexer
DELIMITER
    : ';'
    ;


sql-stmt.g:85:13: rule classDef trapped:
sql-stmt.g:85:13: unexpected token: DELIMITER

Line 85 is the statement rule. I really have no idea why this fails. Please help?

This is with Antlr2 btw. Yes, yes, super old, yes, yes...

Thanks!

Upvotes: 1

Views: 58

Answers (1)

Steve Ebersole
Steve Ebersole

Reputation: 9443

Been playing with Antlr4 too much :) In Antlr2 I guess tokens / rules have to be wrapped in parens to apply * or + or ...

Upvotes: 2

Related Questions