Search Results

Search found 14 results on 1 pages for 'antlrworks'.

Page 1/1 | 1 

  • ANTLRWorks 2: Early Access Preview 10

    - by Geertjan
    I took a quick look at how the ANTLRWorks 2 project is getting on... and discovered that today, March 23, the new early access preview 10 has been released: http://www.antlr.org/wiki/display/ANTLR4/1.+Overview Downloaded it immediately and was impressed when browsing through the Java.g file that I also found on the Antlr site: (Click to enlarge the image above.) On the page above, the following enhancements are listed: Add tooltips for rule references Finally fixed the navigator update bug Major improvements to code completion Fix legacy mode Many performance and stability updates I've blogged before about how the developers on the above project consider their code completion to be "scary fast". Some discussions have taken place about how code developed by the ANTLRWorks team could be contributed to the NetBeans project, since NetBeans IDE and ANTLRWorks 2 are both based on the NetBeans Platform.

    Read the article

  • problem antlrworks code too large

    - by BB
    In Antlrworks I get this error: [18:21:03] Checking Grammar Grammar.g... [18:21:26] Grammar.java:12: code too large [18:21:26] public static final String[] tokenNames = new String[] { [18:21:26] ^ [18:21:26] 1 error Using instead the generated code in a Java project works normally. What can be had this problem? Thanks.

    Read the article

  • Antlr question: cannot get Antlr tool to compile simple file from ANTLRWorks

    - by Don Henton
    Here is the grammar file: grammar fred; test : 'fred'; Here is the batch file to launch the tool: SET JAVA_HOME=C:\Program Files\Java\jdk1.6.0_24 SET PATH=%PATH%;%JAVA_HOME%\bin SET ANTLR_HOME=c:/users/don/workspace/antlrAssign/lib/ java -cp %ANTLR_HOME%/antlr-3.3-complete.jar antlr.Tool fred.g Here's the result: ANTLR Parser Generator Version 2.7.7 (20060906) 1989-2005 fred.g:1:1: unexpected token: grammar error: Token stream error reading grammar(s): fred.g:3:19: expecting ''', found 'r' fred.g:1:1: rule grammar trapped: fred.g:1:1: unexpected token: grammar TokenStreamException: expecting ''', found 'r' Prior postings refer to "org.antlr.Tool" but the 3.3 jar has it located as above. The idea was to create a debug version of a tree parser, and according to the documentation, you have to use the command line tool. Has anyone seen this before? Am I nuts? It's two lines long and its dying on the first word in the file. Of course this compiles in antlrworks. Any help appreciated, I can't afford any more adjustments to my medications.

    Read the article

  • Looking for Antlr Grammar syntaxt highlight in VS2010

    - by David Mårtensson
    I am looking for some way to edit antlr grammar files directly within VS2010 with syntax highlight. I have used antlrworks a lot but it has the drawback that I have to start antlrworks separately and then browse to the file I want to edit, do the changed and save. For minor fixes I do not need all the tools in Antlrworks but I still would like the syntax highlight. But I have not been able to get VS2010 to open antlrworks with the right file and I have found no other way to get syntax highlight directly within VS2010 editor, it just opens as plain text. I can get visual studio to open antlrworks but it will open with only the last set of files it had open, not the one I clicked on. So my question(s) are: Is there a way to get antlrworks to open with the right file when I double click in it in visual studio project explorer? Is there any other way to get correct syntax highlight for antlr grammar files within visual studio (or with another editor, preferably not one that costs money, but if there are no free ones a commercial one might be an option).

    Read the article

  • Visualizing an AST created with ANTLR (in a .Net environment)

    - by Benjamin Podszun
    Hi there. For a pet project I started to fiddle with ANTLR. After following some tutorials I'm now trying to create the grammar for my very own language and to generate an AST. For now I'm messing around in ANTLRWorks mostly, but now that I have validated that the parse tree seems to be fine I'd like to (iteratively, because I'm still learning and still need to make some decisions regarding the final structure of the tree) create the AST. It seems that antlrworks won't visualize it (or at least not using the "Interpreter" feature, Debug's not working on any of my machines). Bottom line: Is the only way to visualize the AST the manual way, traversing/showing it or printing the tree in string representation to a console? What I'm looking for is a simple way to go from input, grammar - visual AST representation a la the "Interpreter" feature of ANTLRWorks. Any ideas?

    Read the article

  • How to get rid of the following multiple alternatives warnings in my ANTLR3 grammar?

    - by Jarrod Roberson
    [11:45:19] warning(200): mygrammar.g:14:57: Decision can match input such as "','" using multiple alternatives: 1, 2 As a result, alternative(s) 2 were disabled for that input [11:45:19] warning(200): C:\Users\Jarrod Roberson\mygrammar.g:14:57: Decision can match input such as "','" using multiple alternatives: 1, 2 As a result, alternative(s) 2 were disabled for that input I want to be able to nest functions inside other functions. myfunction(x) -> sqr(a) -> a * a, y = sqr(x). here is the line it is complaining about function : ID '(' args ')' '->' statement (',' statement)* ; and here is what it is considering the alternative statement : ATOM | expression | assignment | function ; Here is what the synatx diagram looks like in ANTLRWorks I really like things to compile/work without any warnings. How do I resolve this warning condition?

    Read the article

  • Creating AST for shared and local variables

    - by Rizwan Abbasi
    Here is my grammar grammar simulator; options { language = Java; output = AST; ASTLabelType=CommonTree; } //imaginary tokens tokens{ SHARED; LOCALS; BOOL; RANGE; ARRAY; } parse : declaration+ ; declaration :variables ; variables : locals ; locals : (bool | range | array) ; bool :ID 'in' '[' ID ',' ID ']' ('init' ID)? -> ^(BOOL ID ID ID ID?) ; range : ID 'in' '[' INT '..' INT ']' ('init' INT)? -> ^(RANGE ID INT INT INT?) ; array :ID 'in' 'array' 'of' '[' INT '..' INT ']' ('init' INT)? -> ^(ARRAY ID INT INT INT?) ; ID : (('a'..'z' | 'A'..'Z'|'_')('a'..'z' | 'A'..'Z'|'0'..'9'|'_'))* ; INT : ('0'..'9')+ ; WHITESPACE : ('\t' | ' ' | '\r' | '\n' | '\u000C')+ {$channel = HIDDEN;} ; INPUT flag in [down, up] init down pc in [0..7] init 0 CA in array of [0..5] init 0 AST It is having a small problem. Variables (bool, range or array) can be of two abstract types 1. locals (each object will have it's own variable) 2. shared (think of static in java, same for all object) Now the requirements are changed. I want the user to input like this NEW INPUT domains: upDown [up,down] possibleStates [0-7] booleans [true,false] locals: pc in possibleStates init 0 flag in upDown init down flag1 in upDown init down map in array of booleans init false shared: pcs in possibleStates init 0 flag in upDown init down flag1 in upDown init down maps in array of booleans init false Again, all the variables can be of two types (of any domain sepecified) 1. Local 2. Shared In Domains: upDown [up,down] possibleStates [0-7] upDown, up, down and possibleStates are of type ID (ID is defined in my above grammar), 0 and 7 are of type INT Can any body help me how to convert my current grammar to meet new specifications.

    Read the article

  • ANTLR lexer mismatches tokens

    - by Barry Brown
    I have a simple ANTLR grammar, which I have stripped down to its bare essentials to demonstrate this problem I'm having. I am using ANTLRworks 1.3.1. grammar sample; assignment : IDENT ':=' NUM ';' ; IDENT : ('a'..'z')+ ; NUM : ('0'..'9')+ ; WS : (' '|'\n'|'\t'|'\r')+ {$channel=HIDDEN;} ; Obviously, this statement is accepted by the grammar: x := 99; But this one also is: x := @!$()()%99***; Output from the ANTLRworks Interpreter: What am I doing wrong? Even other sample grammars that come with ANTLR (such as the CMinus grammar) exhibit this behavior.

    Read the article

  • Visage

    - by Geertjan
    Raj, the Chennai JUG lead, together with others from that JUG, is interested in Visage, the JavaFX script language closely associated with Stephen Chin. He sent me the related lexer and parser and I started by having a look at them in the new version of ANTLRWorks being developed by Sam Harwell (who demonstrated it very effectively during JavaOne): Notice how the lexer and parser are shown in a tree structure, as well as in a cool syntax diagram. Next, I downloaded a bunch of JARs from here, so that packages such as from "com.sun.tools.mjavac" can be used, i.e., these are Visage-specific packages that aren't found anywhere except in the location below: http://code.google.com/p/visage/wiki/GettingStarted It turns out that there's also a Visage NetBeans plugin out there: http://code.google.com/p/visage/source/browse/?repo=netbeans-plugin Rather than recreating everything from scratch, i.e., generating ANTLR Java classes from the lexer and parser, I copied a lot of stuff from the site above and now a file Raj sent me looks as follows, i.e., basic syntax coloring is shown: For anyone wanting to seriously support Visage in NetBeans IDE, I recommend downloading the existing Visage NetBeans plugin above, rather than creating everything yourself from scratch, and then figuring out how to use that code in some way, i.e., add the JARs I pointed to above, and work on its build.xml file, which could be frustrating in the beginning, but there's no point in recreating everything if everything already exists.

    Read the article

  • Dart and NetBeans IDE 7.4

    - by Geertjan
    Here's the start of Dart in NetBeans IDE. Basic Dart editing support is done and on saving a Dart file the related JavaScript files are automatically generated. In the context of an HTML5 application in NetBeans IDE, that gives you deep integration with the embedded browser and, even better, Chrome, as well as Chrome Developer Tools. Below, notice that the "Sunflower Spectacular" H1 element is selected (click the image to enlarge it to get a better view), which is therefore highlighted in the live DOM view in the bottom left, as well as in the CSS Styles window in the top right, from where the CSS styles can be edited and from where the related files can be opened in the IDE. Identical features are available for Chrome, as well as on Android and iOS. And if you like that, watch this YouTube movie showing how Chrome Developer Tools integration can fit directly into the workflow below. Anyone want to help get this plugin further? What's needed: Much deeper Dart editing support, i.e., right now only very basic syntax coloring is provided, i.e., an ANTLR lexer is integrated into the NetBeans syntax coloring infrastructure. Parsing, error checking, code completion, and some small code templates are needed. A new panel is needed in the Project Properties dialog on NetBeans HTML5 projects for enabling Dart (i.e., similar to enabling Cordova), at which point the "dart.js" file and other Dart artifacts should be added to the project, so that a Dart project is immediately generated and the application should be immediately deployable. Whenever changes are made to a Dart file, Dart should run in the background to create the Dart artifacts in some hidden way, so that the user doesn't see all the Dart artifacts as is currently the case. Some way of recognizing Dart projects (there's a YAML file as an identifier) and creating NetBeans HTML5 projects from that, i.e., from Dart projects outside the IDE. I think that's all... The official Dart Editor is based on Eclipse and requires a massive download of heaps of Eclipse bundles. Compare that to the NetBeans equivalent, which is a very small "HTML5 and PHP" bundle (60 MB), available here, together with the above small Dart plugin. Plus, when you look at how NetBeans IDE integrates with a bunch of Google-oriented projects, i.e., Chrome, Chrome Developer Tools, and Android (via Cordova), that's a pretty interesting toolbox for anyone using Dart. And bear in mind that ANTLRWorks, Microchip, and heaps of other organizations have built and are building their tools on top of NetBeans!

    Read the article

  • Netbeans and EOF

    - by sqlnoob
    Hey there, Java, ANTLR and Netbeans newbie here. I have installed a jdk and netbeans. I started a new project on netbeans 6.8 and i have added the antlr-3.2.jar as a library. I also created a lexer and parser class using AntlrWorks. These classes are named ExprParser.java and ExprLexer.java. I copied them into a directory named path-to-netbeans-project/src/parsers. I have a main file: package javaapplication2; import org.antlr.runtime.*; import parsers.*; public class Main { public static void main(String[] args) throws Exception{ ANTLRInputStream input = new ANTLRInputStream(System.in); ExprLexer lexer = new ExprLexer(input); CommonTokenStream tokens = new CommonTokenStream(lexer); ExprParser parser = new ExprParser(tokens); parser.prog(); } } The application builds fine. The book I'm reading says I should run the program and type in some stuff and then press Ctrl+Z (I'm on windows) to send EOF to the console. Problem is that nothing happens when I press Ctrl+z in the netbeans console. When I run from the command line, ctrl+z works fine. This is probably WAY too much information, but I can't figure it out. Sorry. Probably not a good idea to learn 3 new technologies at once.

    Read the article

  • Antlr MismatchedSetException During Interpretation

    - by user1646481
    I am new to Antlr and I have defined a basic grammar using Antlr 3. The grammar compiles and ANTLRWorks generates the Parser and Lexer code without any problems. The grammar can be seen below: grammar i; @header { package i; } module : 'Module1'| 'Module2'; object : 'I'; objectType : 'Name'; filters : EMPTY | 'WHERE' module; table : module object objectType; STRING : ('a'..'z'|'A'..'Z')+; EMPTY : ' '; The problem is that when I interpret the table Parser I get a MismatchedSetException. This is due to having the EMPTY. As soon as I remove EMPTY from the grammar, the interpretation works. I have looked on the Antlr website and some other examples and the Empty space is ' '. I am not sure what to do. I need this EMPTY. As soon as I change the EMPTY to be the following: EMPTY : ''; instead of: EMPTY : ' '; It actually interprets it. However, I am getting the following Exception: Interpreting... [10:57:23] problem matching token at 1:4 NoViableAltException(' '@[1:1: Tokens : ( T__4 | T__5 | T__6 | T__7 | T__8 | T__9 | T__10 | T__11 | T__12 | T__13 | T__14 | T__15 | T__16 );]) [10:57:23] problem matching token at 1:9 NoViableAltException(' '@[1:1: Tokens : ( T__4 | T__5 | T__6 | T__7 | T__8 | T__9 | T__10 | T__11 | T__12 | T__13 | T__14 | T__15 | T__16 );]) When I take out the EMPTY, there are no problems at all. I hope you can help.

    Read the article

1