Questions tagged [sablecc]

SableCC is a parser generator which generates fully featured object-oriented frameworks for building compilers, interpreters and other text parsers. In particular, generated frameworks include intuitive strictly-typed abstract syntax trees and tree walkers. SableCC also keeps a clean separation between machine-generated code and user-written code which leads to a shorter development cycle.

SableCC is a parser generator which generates fully featured object-oriented frameworks for building compilers, interpreters and other text parsers. In particular, generated frameworks include intuitive strictly-typed abstract syntax trees and tree walkers. SableCC also keeps a clean separation between machine-generated code and user-written code which leads to a shorter development cycle.

http://sablecc.org/

See also

29 questions
0
votes
0 answers

Shift/reduce conflict using SableCC

shift/reduce conflict in state [stack: PFamilia TClasse TCid TBlocoIni TCons PTipoPrimitivo TId TAtribuicaoConst TId *] on TPontoEVirg in { [ PFatorArt = TId * ] followed by TPontoEVirg (reduce), [ PLogicChamAtr = TId * TPontoEVirg ]…
0
votes
1 answer

Conditions - parsing grammar SableCC

I'm using sableCC and I try to built a grammar that accepts conditions like in C.However I'm getting errors when I try to add parentheses on my conditions because there is a conflict with the parentheses I have for the expressions. eg it accepts 4 =…
Alex R.
  • 459
  • 5
  • 16
0
votes
1 answer

Installing SableCC in Eclipse Linux

I am trying to install SableCC in Eclipse in Linux machine. I have followed the instruction given on this http://web.archive.org/web/20090318023544/http://www.comp.nus.edu.sg/~sethhetu/rooms/Tutorials/EclipseAndSableCC.html, which is for Windows,…
Kate Drak
  • 1
  • 2
0
votes
1 answer

Sablecc shift/reduce conflicts on productions with identifiers

I'm trying to write a specification file for sablecc for a version of minipython (with postfix/prefix increment and decrement operators), and some productions naturally need to use identifiers, but i get these conflicts during parsing: shift/reduce…
0
votes
1 answer

Getting started with SableCC

I am a total beginner in programming and for school i have to make a little SableCC project. However im not sure how to use SableCC properly. I have downloaded it from sablecc.org and i did what was said in the readme to install it. So after…
ceso
  • 101
  • 1
  • 6
0
votes
1 answer

Understanding grammar in SableCC

I am going through sableCC for one of my projects and I have few queries about the Grammar file. 1. What is the difference between Helper and Tokens? 2. What should go in helper and Token? 3. And most importantly what is Productions?
bharani
  • 81
  • 1
  • 8
0
votes
1 answer

Setting up Sablecc in eclipse

I have followed the steps mentioned in the link: Setting up sablecc in Eclipse to install scablecc. I am trying to do step 9 mentioned in the link but I get the Error:Could not find or load main class. Can any one guide me how to set up sable cc in…
bharani
  • 81
  • 1
  • 8
0
votes
1 answer

SableCC parsing given wrong result

I tried to parse the valid message using sablecc. There are three type of valid message format. aaa; (three continuous alpha character +semi {messageid} messageid semi ) mm; ( or two continuous alpha or numeric character {flightnum} carriercode…
0
votes
1 answer

SableCC not hitting interpreter methods

I am new to SableCC. Just ran the calculator example at http://sablecc.sourceforge.net/thesis/thesis.html#PAGE26. I used the grammar file and interpreter file as they are, and tried to parse simple arithmetic expression like "45 * 5 + 2". The…
0
votes
1 answer

SableCC expecting: EOF

I'm doing an assignment on Compilers for my university, and I am using SableCC 3.7 for the first time. I am trying to define my grammar file, but when I try to run it (via command line) I get this error: "ParserException: [51,5] expecting:…
Razor88
  • 221
  • 1
  • 5
  • 18
0
votes
1 answer

Problems With SableCC Grammar File

I seem to be having issues with SableCC generating the relevant lexer, node and parse stuff that it normally automatically generates from a grammar file. I'm not implementing an Abstract Syntax Tree at the moment. When I try to run SableCC with the…
Curiosity
  • 111
  • 6
0
votes
1 answer

Changing associativity schema in a grammar

I'm trying to use SableCC to generate a Parser for models, which I call LAM. LAM in itself are simple, and a simple grammar (where I omit a lot of things) for these is: L := 0 | (x,y) | F(x1,...,xn) | L || L | L ; L I wrote this…
kronat
  • 75
  • 4
0
votes
1 answer

Loading a class in a .jar file created programmatically

Here's my goal: Use SableCC to generate several parsers/lexers at runtime and load instances of them for parsing and lexing. So I figured my steps would be: Generate the .java files using SableCC. I think I've done this, fine. Compile the .java…
Jesus is Lord
  • 14,971
  • 11
  • 66
  • 97
0
votes
1 answer

How to get an smth like EOF symbol from file in java

Good day, everyone. I'm using sableCC, and it takes as input a Reader object. For example this code works correctly: compile (new StringReader ("print 1")); Because StringReader returns -1 after the string is over: StringReader sr = new…
Necto
  • 2,594
  • 1
  • 20
  • 45
1
2