-1

I have a grammar for parsing jcl

The jcl looks like below /*comment line //PR1290@ JOB (10),'ISPW COB SN900E'

lexer and parser is working perfectly fine. Suppose instead of // if jcl starts from / currently lexer is throwing 1:0 token recognition error at: '/P'

Parser will throw no viable alternative input R1290@ JOB

I am looking for throwing error similar to eclipse while editing.

public void Test(){
//test 
//}

Above will say syntax error insert } to complete method body..

Something similar to this I want to point out right error message saying "jcl lines should start with // "

Example jcl line is below //NAME Operationname parameter=parametervalue

If // is missing i want to throw saying line should start with // Operation name should be either JOB or PROC if keyword is missing then enter valid keyword parameter

and if any parameter is missing i want to point out that write meaning full message to user.

I am using antlr 4.7.2 version

kiranNswamy
  • 126
  • 9

1 Answers1

0

You can start with adding your own error listener ...

See https://learning.oreilly.com/library/view/the-definitive-antlr/9781941222621/f_0062.html

I find it enough but you will likely need more

YaFred
  • 9,698
  • 3
  • 28
  • 40