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
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
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.
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
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
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
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
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
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
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
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
For visual basic you need a much more involved rule:
assignStatement
: lvalues
(
// Assignments
//
(
compoundBinaryOperator
)
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
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
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
15 matches
Mail list logo