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
9
votes
5 answers

Best way to parse bbcode

I'd like to work on a bbcode filter for a php website. (I'm using cakephp, it would be a bbcode helper) I have some requirement. Bbcodes can be nested. So something like that is valid. [block] [block] [/block] [block] …
Loïc Faure-Lacroix
  • 13,220
  • 6
  • 67
  • 99
8
votes
1 answer

Testing a compiler

I'm currently working on kind of compiler that was built making use of sablecc. Long story short, the compiler will take as input both specification files(this is what we're parsing) and .class files and will instrument the .class files bytecode so…
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
3
votes
1 answer

Custom text editor for Eclipse starting from a parser created with SableCC

The question of today is the following: I'm developing a code generator for my department at university. It's very simple: they want to use a custom "scripting" language really human readable, parse that and then translate these instructions in…
dierre
  • 7,140
  • 12
  • 75
  • 120
2
votes
1 answer

ANTLR or SableCC for DSL Implementation?

Has somebody used both for Language implementation and is able to compare them, pointing out strengths and weaknesses? I seek a RAD tool with support for AST Walker Code generation. SableCC is LALR and thus supports ´Left recursion´, whereas ANTLR…
Matthias Hueser
  • 255
  • 1
  • 3
  • 11
2
votes
1 answer

shift/reduce conflict with SableCC

I'm at my first experience with SableCC and grammar definition. I have the following grammar (a part of it): query = {atop} attroperator | {query_par} l_par query r_par | {query_and} [q1]:query logic_and [q2]:query …
dierre
  • 7,140
  • 12
  • 75
  • 120
2
votes
2 answers

EBNF grammar for OData URI query

Does anyone have or know where to find a EBNF grammar for OData URI query? I want to use it with SableCC to generate C++ classes for parsing OData URI queries.
1
vote
1 answer

SableCC expecting EOF

I seem to be having issues with SableCC generating lexing.grammar This is what i run on sableCC Package lexing ; // A Java package is produced for the // generated scanner Helpers num = ['0'..'9']+; // A num is 1 or more decimal digits letter =…
1
vote
1 answer

How does Maven know where input files come from and where output files go during the generate-sources phase?

I am new to Maven. I have a project which includes a grammar definition file that is read by SableCC, which is a parser generator. SableCC reads a grammar file and generates Java source code that, once compiled, creates a parser. The parser is…
mbmast
  • 960
  • 11
  • 25
1
vote
0 answers

Should 'Start' and 'End' in this arbitrary language be token regarding with the CFG?

So, I am writing a CFG body to generate compiler via SableCC, and the given samples have these "Start" and "End" at the beginning of the program and end of it, respectively. Sample code Start Print 10; int a,b; End I suppose they are also tokens,…
1
vote
1 answer

Problem with reverse derivation with a simple sum and multiply grammar

I am having some trouble understanding how to, using a bottom up parser and for example, the input string 1 + 2 * 3, go from the "bottom" to the "top". Here's the grammar I'm using (I'd say it's correct as it's the one found in Crafting a…
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
1
vote
2 answers

Problem with sablecc on production rule of the form prod = (expr | expr')*

Productions program = cls*; cls = clsdef name openbrace clsdata closingbrace; clsdata = (clsfield|clsmethod)*; clsfield = [variabletype]:name [variablename]:name semi; clsmethod = [returntype]:name [methodname]:name…
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
1
vote
1 answer

Shift/reduce conflicts using Sablecc

I'm supposed to write a .grammar file for MiniPython using Sablecc. I'm getting these shift/reduce conflicts: shift/reduce conflict in state [stack: TIf PTpower *] on TMult in { [ PMltp = * TMult PTopower Mltp ] (shift) [ PMlpt = * ]…
0
votes
1 answer

productions for Sable CC parser generator

it looks pretty basic, but for the last half hour I couldnt find out why we say {zero} or {one} in the following productions what does the {} indicate? bit = {zero} zero | {one} one ;
shebelaw
  • 3,992
  • 6
  • 35
  • 48
0
votes
3 answers

Deleting certain classes on running an external tool in eclipse?

I've set an external tool (sablecc) in eclipse (3.4) that generates a bunch of classes in the current project. I need to run this tool and regenerate these classes fairly frequently. This means that every time I want to run sablecc, I have to…
Paul Wicks
  • 62,960
  • 55
  • 119
  • 146
0
votes
1 answer

Maven not running generate goal during Maven build or Maven generate-sources from within Eclipse

I'm new to Maven and cannot seem to get a generate goal to run. I'm using Maven from within Eclipse. Here is the POM.XML:
mbmast
  • 960
  • 11
  • 25
1
2