txross1993 / abap-authorship-classifier

Use deep learning methods to extract relevant features that represent authorship of ABAP code.
1 stars 0 forks source link

AST #2

Open larshp opened 5 years ago

larshp commented 5 years ago

Hi, Cool project

You can take a look at https://playground.abaplint.org for building the AST, its as far as I know the only open source project which has something close to a complete AST.

txross1993 commented 5 years ago

@larshp Thank you for this -- this is what I've been searching for. Maybe I won't have to go write a parser in chevrotain after all.

larshp commented 5 years ago

Syntax diagrams are at https://syntax.abaplint.org, some extra code can take these syntax diagrams and generate syntax for use in other languages.

I've spent quite some time trying to use general purpose parsers like ANTLR for parsing ABAP, but I did not succeed, as its difficult to express a LL(K) grammar for ABAP due to its pattern matching nature. Example: in https://syntax.abaplint.org/?filter=WRITE#/statement/Write the rightmost part can be sequenced in any way. Plus keywords is also not a thing in ABAP.

Anyhow, let me know if I can help with the AST, playground.abaplint.org has some examples. I can add a feature for the abaplint command line tool to dump the AST as a json file?