I'm using this grammar https://github.com/antlr/grammars-v4/tree/master/plsql for Antlr4 but I'm getting an error because its referring to a function that does not exist.
'NameError: name 'IsNewlineAtPos' is not defined '
I can see that someone has updated the csharp version two files (that are extra items? Base lexer and Parser? That include an update that refers to the function in the below code.
// https://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_twelve034.htm#SQPUG054
REMARK_COMMENT: 'REM' {IsNewlineAtPos(-4)}? 'ARK'? (' ' ~('\r' | '\n')*)? NEWLINE_EOF -> channel(HIDDEN);
// https://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_twelve032.htm#SQPUG052
PROMPT_MESSAGE: 'PRO' {IsNewlineAtPos(-4)}? 'MPT'? (' ' ~('\r' | '\n')*)? NEWLINE_EOF;
// TODO: should starts with newline
START_CMD
//: 'STA' 'RT'? SPACE ~('\r' | '\n')* NEWLINE_EOF
// https://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12002.htm
// https://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12003.htm
: '@' {IsNewlineAtPos(-2)}? '@'? ~('\r' | '\n')* NEWLINE_EOF
;
This is the update on git
https://github.com/antlr/grammars-v4/commit/94887a3f4c9040578ef01b561e1d5e0ec54cbe9b
I'm using Python to run this and would appreciate if someone could tell me why they 'extend' and what this function they create does. (and if they can show me how to convert to python 3 that would be awesome)