How can I parse REXX code in Java?

I would like to analyze the source of REXX so that I can analyze the structure of the program with Java.

I need to do things like normalize equivalent logical structures in the source that are syntactically different, find declarations of duplicate variables, etc., and I already have a Java background.

Any easier ways to do this than writing a load of code?

+5
source share
3 answers

If you have BNF , a Rexx grammar, then javacc can help you create an AST (abstract syntax tree) representation of this Rexx code.

, javacc Java, :

  • Rexx
  • AST.

" ", Rexx. .

+5

REXX - , , BNF. , , C, REXX , . , , (, "PULL" PULL PARSE PULL - PULL ( "PULL = 1 + 2" )). , . ANSI REXX .

+8

ANTLR, AST, ..... (ANTLRWorks), Java / . .

+1
source

All Articles