Skip to main content

ANTLR parsing file for BASIC/C

  • Feb 12, 2024 11:02 PM UTC
  • 2 replies
  • 34 views

Lamont Lockwood

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 replies

Ian McGowan
  • Participating Frequently
  • Feb 14, 2024 4:45 PM UTC

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
------------------------------

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
------------------------------

  • New Participant
  • Feb 15, 2024 8:47 AM UTC

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
------------------------------

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
------------------------------