[il-antlr-interest: 33031] [antlr-interest] alternatives to linq LambdaExpression Compile method

2011-07-05 Thread Costa Basil
I have a program that has to compile and execute formulas on the fly. I am using antlr to build linq expression trees which I then compile using the LambdaExpression.Compile() method. The problem is that this method is far too slow. Are there any other alternatives perhaps commercial that woul

[il-antlr-interest: 33032] [antlr-interest] Line start vs non-line ...

2011-07-05 Thread James Ladd
Hi All, I hope this is a simple request to answer. I have a simple preprocessor I want to write but I can't get the rules right. I think I am regex challenged. In simple terms I want to have this: lines : (lineStartingWithPlus | lineNotStartingWithPlus)* ; If these were rules A and B

[il-antlr-interest: 33033] Re: [antlr-interest] Line start vs non-line ...

2011-07-05 Thread Bart Kiers
Hi James, Something like this would do the trick: lines : (LineStartingWithPlus | LineNotStartingWithPlus | LineBreak)* EOF ; LineStartingWithPlus : '+' ~('\r' | '\n')* ; LineNotStartingWithPlus : ~'+' ~('\r' | '\n')* ; LineBreak : ('\r'? '\n' | '\r') ; Regards, Bart.

[il-antlr-interest: 33035] [antlr-interest] same character for multiple rules?

2011-07-05 Thread Roy Metzger
Hi and Hello to everyone, I would really appreciate any hints and advices if someone can give my relating to my problem. I would like to know how to deal with the situation where you would use same character for multiple rules/operations. For example in Visual Basic you use '=' for both variabl

[il-antlr-interest: 33036] [antlr-interest] Think I found a bug.

2011-07-05 Thread James Reid
Hi all, I think I found a bug but I want to be sure. I have a parser grammar that I run two passes on. Here are short versions of the rules. firstpass : (collect_matches | collect_labels | .)* ; script : header? matches* EOF ; When I run the code I use a CommonTokenStrea

[il-antlr-interest: 33037] [antlr-interest] grammar for mixed languages syntax

2011-07-05 Thread Sébastien Kirche
Hi, I would like to build a grammar for a language that can embed sql compliant statements. Basicaly the language is a basic-like case insensitive syntax (with for .. next, if .. end if classic syntax), but you can also insert direct sql statement (that must end by semicolon), for example for sel

[il-antlr-interest: 33038] Re: [antlr-interest] grammar for mixed languages syntax

2011-07-05 Thread Yauhen Yakimovich
Hi Sébastien, What you are trying to build as an interpreter of a language with dynamical features. Hence simple preprocessor will not fit. Try to look for island grammars. Search the example folder for this. 2011/7/5 Sébastien Kirche : > Hi, > > I would like to build a grammar for a language t

[il-antlr-interest: 33042] Re: [antlr-interest] alternatives to linq LambdaExpression Compile method

2011-07-05 Thread Sam Harwell
Hi Costa, There are three options which I might suggest, with the first two being vastly preferred to the last. First of all, you should review your current code to make sure that if a formula gets evaluated multiple times, the compiled expression (Func delegate) is reused. I've successfully used

[il-antlr-interest: 33043] Re: [antlr-interest] antlr 3.4 beta 4 (release candidate)

2011-07-05 Thread Petteri Räty
I can reproduce the exception: attempting LL(1) DFA (d=425) for 639:29: ( DIGIT )? error(10): internal error: libbash.g : java.lang.NullPointerException org.antlr.grammar.v3.CodeGenTreeWalker.atom(CodeGenTreeWalker.java:5250) org.antlr.grammar.v3.CodeGenTreeWalker.element(CodeGenTreeWalker.java:3

[il-antlr-interest: 33044] Re: [antlr-interest] grammar for mixed languages syntax

2011-07-05 Thread Sébastien Kirche
2011/7/5 Yauhen Yakimovich : > Hi Sébastien, > > What you are trying to build as an interpreter of a language with > dynamical features. > Hence simple preprocessor will not fit. > > Try to look for island grammars. Search the example folder for this. Thanks for the tip. Indeed the javadoc parsing

[il-antlr-interest: 33045] Re: [antlr-interest] alternatives to linq LambdaExpression Compile method

2011-07-05 Thread Costa Basil
Hi, Sam thank you for your answer. Just to be clear my problem is that the Compile method is too slow. The code that gets executed as a result of the compilation is fine. Costa List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr

[il-antlr-interest: 33046] Re: [antlr-interest] same character for multiple rules?

2011-07-05 Thread Jim Idle
For visual basic you need a much more involved rule: assignStatement : lvalues ( // Assignments // ( compoundBinaryOperator )

[il-antlr-interest: 33047] Re: [antlr-interest] antlr 3.4 beta 4 (release candidate)

2011-07-05 Thread Terence Parr
ah. right. -Xmx500M brings it right up. ok, fixed. thanks! Ter On Jul 5, 2011, at 7:23 AM, Petteri Räty wrote: > I can reproduce the exception: > > attempting LL(1) DFA (d=425) for 639:29: ( DIGIT )? > error(10): internal error: libbash.g : java.lang.NullPointerException > org.antlr.grammar.v3

[il-antlr-interest: 33048] [antlr-interest] input.TokenStream is null

2011-07-05 Thread Dominik Halfkann
I'm trying to make a TreeWalker for a tree like this: input: int x = 3 output AST: ^(VARDEF int x 3) My parser works just fine and also generates an AST like shown above, but whenever I want to resolve anything from the AST, like with $variableType.text, there is allways a NullReferenceException i

[il-antlr-interest: 33049] Re: [antlr-interest] antlr 3.4 beta 4 (release candidate)

2011-07-05 Thread Mu Qiao
I'm not sure if this problem is related to antlr or the c runtime. I've already fixed the code for the input stream change which Jim mentioned in another email. But when I compile the generated code, I get a lot of errors like the following: libbashLexer.cpp::xx: error: '_empty' was not declare