Rocket U2 | UniVerse & UniData

 View Only
  • 1.  ANTLR parsing file for BASIC/C

    Posted 02-12-2024 23:02

    I read in an earlier post that someone had created an ANTLR file for BASIC or C.

    Do you still have the file? I am new to ANTLR but would like to create a parser for users entering at least BASIC code. 

    Thanks!

    Lamont



    ------------------------------
    Lamont Lockwood
    Integration Expert
    Dallas, Texas
    l2@integrationexpert.com
    ------------------------------


  • 2.  RE: ANTLR parsing file for BASIC/C

    Posted 02-14-2024 16:45

    There is an Antlr grammar file in

    https://sourceforge.net/projects/maverick/

    At maverick-0.3.zip\maverick-0.3\src\org\maverickdbms\tools\BASIC.g.

    It's hard to understand (I don't know antlr) but it looks like a good start, even if it's from 2006...



    ------------------------------
    Ian McGowan
    Principal Consultant
    Rocket Forum Shared Account
    ------------------------------



  • 3.  RE: ANTLR parsing file for BASIC/C

    Posted 02-15-2024 09:11

    I think maybe AbstractTreeWalker.g (in the same "tools" subdirectory) may be a little easier to understand if you are just looking for a BNF. This is a more primitive abstraction of the BNF without the specifics of Java embedded within. It's still kind of confusing, unless you have at least a basic understanding of how grammars are written. When we were working on this all those years ago. I remember many hours of head scratching. Robert Colquhoun was the brains behind the operation, I was just a pack mule.



    ------------------------------
    Allen Bell
    Owner
    PsiWav LLC
    IL US
    ------------------------------