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 is LL(*). Is this important for typical grammars or DSLs? I need to perform some domain-specific analysis as well. (The target language of my compiler will be OpenCL C). As this will be for a student project it is important that I do not lose that much time on the tedious side, that is implementing the Front-End of the language.
ANTLR or SableCC for DSL Implementation?
1.5k views Asked by Matthias Hueser At
1
There are 1 answers
Related Questions in ANTLR
- Difference between antlr4-tools and installation
- How to link custom lexer with ANTLR generated parser
- Evaluating logical expressions recognized by ANTLR using the System.Linq.Expressions namespace
- Why do I get the "mismatched input" error in ANTLR4?
- Is there any convenient way to say "multiple options in any order" in ANTLR 4?
- Why are .java files generated when .cs should be in c#/Antlr4.Runtime.Standart?
- Antlr Input Matching both parsing rule and a Lexer
- Why is ANTLR not recognizing my numeral token
- Antlr Expression comparing two columns in a table
- How to check if token is EOF, and how to get previous token to EOF
- ANTLR4 matches to lexer rule instead of parser rule
- Antlr4 visitor functions wrap the result in an array (more precisely in accept function)
- How can I fix problem with could not find antlr4 jar file at maven.org?
- Antlr4 visitor (JavaScript) returns array of udefined
- JS node.js parser does not start because of parser.MyStartRule()
Related Questions in DSL
- Jmeter Java DSL - getting issues when using rpsThreadGroup
- How to set up URL redirection on D-Link router for specific domain?
- Build array of objects with PactDsl for json request
- Adding my own transpiled file format to Typescript imports
- Nextflow - I/O and index issues
- How can I use version catalogs with Kotlin DSL?
- Groovy dsl dependency injection
- Groovy DSL SecureASTCustomerizer IDE integration
- How to classify this interpreter
- Is this Ruby syntax or is it a DSL and how can I learn Ruby syntax or Rails DSL?
- mutliple definition of preproccessor # value
- Using Groovy map for DSL arguments
- Complex Swift DSL with inter-relationships
- Function literal with a receiver invocation
- How do I eliminate data duplication in querydsl?
Related Questions in ABSTRACT-SYNTAX-TREE
- Javascript to Java
- Resolve complex types using Typescript AST
- AST matcher for C++ #include
- How to parse and group hierarchical list items from an unindented string in Python?
- How can I parse the standard Go package and print all constant variables?
- How to share lexical environment with recursive functions in a custom interpreter?
- How can I use custom grammar with the ast-grep Python API?
- Adding new enumerators to an Enum specifier using CDT ASTRewrite
- library to generate embedding of each line of java file and embeddings must contain ast information
- the expressionType and includePath of CDT parser
- Why Golang ast.Field can have multiple names?
- How to find ast dictionary item in Python using xpath-like expressions
- python multiprocessing locks inside async function
- How to find all function calls a defined function makes? (including recursive and futher down the stack calls)
- Changing the format of data in Python
Related Questions in SABLECC
- SableCC expecting EOF
- Maven not running generate goal during Maven build or Maven generate-sources from within Eclipse
- How does Maven know where input files come from and where output files go during the generate-sources phase?
- Should 'Start' and 'End' in this arbitrary language be token regarding with the CFG?
- Shift/reduce conflict using SableCC
- Shift/reduce conflicts using Sablecc
- Conditions - parsing grammar SableCC
- Installing SableCC in Eclipse Linux
- Sablecc shift/reduce conflicts on productions with identifiers
- Getting started with SableCC
- Understanding grammar in SableCC
- Setting up Sablecc in eclipse
- SableCC parsing given wrong result
- SableCC not hitting interpreter methods
- SableCC expecting: EOF
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
I cannot say much about ANTLR, but maybe some information about SableCC.
Design
It generate a parser, which generated code and hand-written code are clean separated using Visitor pattern, and integrates the transform from Concrete Syntax Tree to Abstract Syntax Tree. As a result the designer can get a AST after the parser parses successful the input, and he can walk through the tree and make action on corresponding nodes.
The designer can first write and debug his grammar, try to optimize the transform from Concrete Syntax Tree to Abstract Syntax Tree. After he has a solid AST he can write action code in separated class. So the designer write grammar only once and can write more type of action for the grammar, for example once for Syntax Highlight, once for Semantic analysis and code generator. I have done it in a productive system. It works very well.
With ANTLR the designer can construct the AST tree by adding action code in grammar t generate the AST, then reuses it for different manner. But there a not a clean separation between generated code and hand-written code.
An other aspect maybe support of IDE. Since with SableCC you have separated code, you can easy use auto-complete function of IDE.
grammar
SableCC is a LR(1) parser generator, so it is IMO easier to write grammar for ANTLR, which is a LL(k) parser generator, (without trick). I think (aber not sure) SableCC is the only one LR(1) java parser generator, which is so popular.
output parser
ANTLR can generate parser in many languages, while SableCC can only generate parser in Java (mainstream). There some plugin / adapter to generate parser in other language, however according to the author (http://www.mare.ee/indrek/sablecc/) they are too old. SableCC 4 can generate more, but it is in beta, which is not recommend for serious project.
Development Support
ANTLR hat a IDE to write grammar. It is ANTLRWorks, which can visual grammar, navigate in source (like jump to definition of token or production). SableCC hat no such tools. There are primitive Syntax Highlight script for VIM and a poor feature plugin for Netbeans.
Conclusion
IMO I think for big project, required long term maintenance SableCC is more suitable than ANTLR.
Martin Fowler has a informative about SableCC, you can find it here. http://martinfowler.com/bliki/HelloSablecc.html