Greetings!
On Sun, 2009-12-13 at 14:20 +0100, Hans-Martin Adorf wrote:
here is an excerpt on a SchemeNumber grammar which is part of a Scheme
grammar that I am toying with.
grammar SchemeNumber;
tokens {
HASH = '#' ;
}
prefix2: RADIX2 EXACTNESS?
| EXACTNESS? RADIX2
='\n',7,channel=99,2:5]
Jean-Claude Durand
LIG, équipe GETALP
385, rue de la Bibliothèque
BP 53
38041 Grenoble cedex 9
France
jean-claude.dur...@imag.fr
tél: +33 (0)4 76 51 43 81
fax: +33 (0)4 76 63 56 86
Le 14 déc. 09 à 19:35, John B. Brodie a écrit :
Greetings!
On Mon
Greetings!
On Mon, 2009-12-21 at 09:08 -0500, Bill Ramsay wrote:
Hello,
I'm new to Antlr and am trying to work through the Definitive Guide. I
can't seem to get the first example to work.
I create the .g file and lexer and parser classes fine. I compile my
example test program fine.
Greetings!
On Tue, 2010-01-12 at 17:06 +0100, Olaf Keijsers wrote:
Greetings,
I am trying to make a treewalker for my grammar in order to check if it
contains nondeterminism. I would like to be able to set some properties for
every node I encounter, so I figured it would be a good idea to
Greetings!
Your WS lexer rule can recognize the empty string, this is VERY bad.
Because WS can recognize the empty string your lexer will enter an
infinite loop when encountering a character it can not deal with - like
the '_' in your example - you have no lexer rule that can handle a '_'.
More
Greetings!
On Thu, 2010-01-21 at 20:20 +0100, Hugo wrote:
I started using antlr to parse a specific file format.
The problem is that i don't know how to write correctly my grammar.
The file have the following format.
It contains multiple lines and each can have the following format:
Only
Greetings!
On Mon, 2010-02-08 at 14:58 -0800, tahiti wrote:
Please, repply on the simple question: how access to generated ast? The
documantation for 3.0 a thery uggly and don't contains necessary
information. I know how to do it in the version 2.0 (there are method
getAST() in Parser class),
On Tue, 2010-02-09 at 10:17 -0800, tahiti wrote:
No, I confused right for lack of return type of this methods. The method
query() that parse entire query has return type boid. It is only modify the
state of the parser class state._fsp located in base class of Parser:
RecognizerSharedState. I
Greetings!
On Wed, 2010-02-10 at 23:05 -0500, cdell...@paragenic.org wrote:
Hi, I am relatively new to ANTLR but I have to make a custom-built grammar
file for the Java language. I am having trouble with a rule for which I
get a
rule arrayInstantiation has non-LL(*) decision due to
Greetings!
On Mon, 2010-02-15 at 22:57 +, Nazim Oztahtaci wrote:
Hi,
I want to write a parser using ANTLR grammar. I would like to translate the
logical expression to Sum of Product form. I give you the example below.
I am not sure that the following will be of any help.
Having the
Greetings!
It is really hard to know for sure how to truly answer your question
without seeing a complete example of your problem (e.g. please always
try to post a *smallest* yet *complete* example of your issue when
asking a question).
With that mealy worded excuse for my incompetence, I will
Greetings!
On Thu, 2010-03-11 at 14:01 +1100, J. Matthew Pryor wrote:
I am a total ANTLR newbie,
Welcome to the crowd!
...stuff snipped...
so when I give it the input
true true
despite the fact that I get the following consle messages
line 1:5 no viable alternative at input ''
Greetings!
On Fri, 2010-03-19 at 15:26 -0400, William Koscho wrote:
Hi All,
I have a tree grammar, and am trying to just print out some information from
the tree. This works fine for matching tokens, but not when matching the
rules. I'm hoping someone can help explain why this is giving
Greetings!
On Fri, 2010-03-19 at 17:01 -0400, venkat medhaj wrote:
Hi,
I have a simple grammar for which I was able to walk through the AST and
printout the input text to the console. I learned that we need to put the
information in the symbol table and do the semantic analysis from there
Greetings!
On Wed, 2010-03-24 at 13:26 -0700, Kaleb Pederson wrote:
I'm rewriting a tree in a way that I think follows the rules. Here's
a sample input fragment:
one == two three == four five == six
The following rewrite works correctly, but then I have to iterate over
the list and
On Thu, 2010-03-25 at 14:52 +0100, Bart Kiers wrote:
On Thu, Mar 25, 2010 at 2:01 PM, Anders Sollander
anders.sollan...@mathworks.de wrote:
Hi,
I've been trying to write a lexer rule for strings with strings in
them,
like
This has a quoted string within
Is there a
Greetings!
On Thu, 2010-04-08 at 20:29 -0400, Cameron Ross wrote:
Hi,
I have a grammar that calls a rule from two different levels. This leads
to an ambiguity being reported from the two different calls to the rule.
Oddly, the ambiguity points to the same place, so I'm not sure why its
Greetings!
On Tue, 2010-04-20 at 14:37 +, Molka Tounsi wrote:
I tried this example on ANTLRWORK but it shows me errors.
This is the code:
class CalcParser extends Parser;
options {
buildAST = true;// uses CommonAST by default
}
expr
: mexpr (PLUS^ mexpr)*
Greetings!
On Thu, 2010-04-22 at 12:04 -0800, kumarr wrote:
Hi all,
I have defined a token called GEN that can take on various string values.
The grammar is below.
The token is question is GEN. I'm trying to parse a very simple string
conforming to this grammar: Unavailable(LEP). When it
Greetings!
On Mon, 2010-04-26 at 19:02 -0400, Kunal Sawlani wrote:
Hi,
Thanks to both of you, I have something which works now. However, I am
running into a slight issue, where the parser complaints that ANYTHING
is not defined, in case of the grammar Jim suggested, and for John's
grammar,
On Tue, 2010-05-18 at 17:10 +0200, Sameh W. Zaky wrote:
OK, Sorry for that!
Just after I have sent this message I realized that the problem is that
ANTLR cannot find my method myLookUpMethod..
I have defined it in @members{} part of the grammar file.. But ANTLR still
cannot find it.. Any
Pardon me for butting in.
And I have never used the C code generator, but.
On Wed, 2010-05-19 at 14:06 -0700, Alan Condit wrote:
which I assume, based on the comment, is generated from this rule:
line : line_number? segment+ K_NEWLINE
- ^(STMT segment+)
|
Greetings!
I am unable to compile your combined grammar.
On Mon, 2010-05-24 at 12:55 +0400, Ламер wrote:
STRING_LITERAL
: ''
{ StringBuilder b = new StringBuilder(); }
( c=~('' | '\r' | '\n'/* | VARIABLE*/)
{ b.appendCodePoint(c); }
Hello :-
This grammar still has the same compilation problem as the one that you
posted yesterday. did you change anything?
I fixed the STRING_LITERAL rule as you suggested in a private e-mail to
me (please keep all messages on this list).
I then did not get any ClassCastException. But got
On Tue, 2010-05-25 at 21:12 +0200, Sameh W. Zaky wrote:
Hi all,
Using ANTLR v3.2, in the runtime I generate the lexer and parser Java files
using this code:
org.antlr.Tool.main(new String[]{projectPath+GrammarFile.g});
The problem is that, after this line of code, no other code gets
On Wed, 2010-06-02 at 17:03 -0500, Ken Williams wrote:
Yeah, probably I should be using parser rules. I was trying to keep things
simple by making everything a linear stream of tokens from the point of
view of the Java caller, while still having high-level constructs like DATE.
Perhaps what
Greetings!
On Tue, 2010-06-22 at 04:22 -0400, Pavel Grinfeld wrote:
Hi,
Here's my first attempt at an ANTLR project. For practice, I just want
to read a file with lowercase words and print them. I feed it hi there
how are you
All that the program prints is hi.
Many thanks in advance,
Greetings!
On Tue, 2010-06-22 at 11:08 -0400, Pavel Grinfeld wrote:
Hi,
I'm begging to get my bearings on this But the following gives two
multiple alternatives warnings.
How come?
Many thanks in advance,
Pavel
grammar PGTeX;
doc
:
Greetings!
On Thu, 2010-06-24 at 16:23 +0200, Scherer Markus wrote:
I am currently working on a grammar, that converts SQL*PLUS scripts in JDBC
compatible statements.
Basically I am separating the different statements in
* normal SQL statements (to be JDBC compatible, the trailing
Greetings!
On Fri, 2010-06-25 at 03:00 +0200, Olivier Lefevre wrote:
Greetings ANTLR experts,
I have the attached toy grammar for integer arrays of arbitrary
depth but the stat rule has non-LL(*) decision due to recursive
rule invocation. It is recommended to left-factor or to use a
Greetings!
On Mon, 2010-07-05 at 22:18 -0600, Andrew Robinson wrote:
Sorry to say that ANTLR is driving me nuts, starting to really hate
the tool, so I'd really appreciate some help on it before I give up on
it.
Sorry for your frustration. I hope you hang in there. I think ANTLR is
worth its
On Tue, 2010-07-06 at 09:47 -0400, John B. Brodie wrote:
snipped
change all references to TEXT to be text
sorry, should be: change all references to TEXT to be text+
I thought that maybe i should test what I am recommending so attached
please find a grammar that parses your example
On Mon, 2010-07-12 at 22:11 -0400, Reynold Xin wrote:
I have the following grammar file. When I was running it in Java using ANTLR
works, it compiles without any problem. However, when I was using the Python
target:
# java -cp antlr-3.1.2.jar org.antlr.Tool bibtex.g
It prompts the error:
On Mon, 2010-07-19 at 14:29 -0400, Bill Andersen wrote:
Hi folks
Greetings!
Having some trouble making ASTs using a custom node type. Before I ask any
stupid questions, what is the best place to look on how to do this ( I'm
using 3.2 )? I'm finding bits and pieces, some of them
Greetings!
On Fri, 2010-08-06 at 02:16 -0400, Ken Klose wrote:
Hello,
I'm writing my first grammar and have started with something painfully
simple but yet cannot figure out why I am receiving errors. At this point
I expect my grammar to recognize a whitespace delimited list of integers.
Greetings!
you really need to left factor your rules.
also lex_entry and rule_entry are identical rules! ambiguous. even with
backtracking turned on how are we to know which to recognize. and
perhaps worse, we can not know that we have a type_def (as opposed to
lex_entry or rule_entry) until the
On Fri, 2010-08-06 at 12:07 -0400, Kevin J. Cummings wrote:
On 08/06/2010 07:33 AM, John B. Brodie wrote:
stuff snipped
WS: (' ' | '\t' | '\n' | '\r' | '\f') {$channel = HIDDEN;};
this rule recognizes (and then ignores) just a single white-space
character. would be more efficient
Greetings!
On Fri, 2010-08-06 at 16:41 +0100, Luis Pureza wrote:
Hi,
I need some help from the ANTLR wizards :)
I am not sure I qualify as an ANTLR wizard, but I try to answer your
question anyway
I'm trying to match expressions with field accesses and array indexes.
For example:
On Sat, 2010-08-07 at 04:31 -0400, Ken Klose wrote:
I have arrived at a new problem that I can't resolve. I am parsing a rather
simple data file and have to read a field that can be a number of the forms
55, +55, -55, or .. in case where no number has been assigned. I've
tried the following
Greetings!
the ^ meta-operator in the suffix position is a tree construction
operation and is NOT valid for tree recognition. you should be getting a
warning similar to:
warning(149): treeTest.g:0:0: rewrite syntax or operator with no output
option; setting output=AST
or if you have already set
Greetings!
passing the FROM tree down the rule set doesn't seem too bad to me.
DISCLAIMER: i can barely spell C# and certainly know nothing whatsoever
about LINQ --- so i probably have mis-understood something crucial.
On Sun, 2010-08-08 at 19:10 +0100, Luis Pureza wrote:
Hi,
I'm writing a
On Sun, 2010-08-08 at 20:50 -0400, Kevin J. Cummings wrote:
On 08/08/2010 08:35 PM, Ken Klose wrote:
Thanks for replying.
2. is not a valid PRICE. PRICE should have at least 1 digit following the
'.'. In the context of the string that I am trying to match 2. doesn't
have any
Greetings!
On Wed, 2010-08-11 at 22:57 -0300, Victor Giordano wrote:
Hi there!!. How you doing guys? Hope good!.
I am fine, I hope you are too!
A have another question about tokens and lexical rules, i really don't
get the idea...
For example, assume we have this:
1)
tokens
{
Greetings!
On Sun, 2010-08-29 at 07:40 -0700, Ted Hoise wrote:
VERY simple example
rule : 'H' ;
When I test this very simple rule, it works (in Antlrworks and Eclipse) of
course for input 'H', but it also works for input 'fH', resulting in a token
'fH'. I do I suppress this behavior:
Greetings!
On Mon, 2010-08-30 at 13:01 -0700, st3 wrote:
Hi,
I have a simple grammar - which includes a '+' or '-' operation on a
variable (ID) or constant (INT).
The add rule is obviously: mult (+/- mult).
However, the way I need the add rule defined throws the
Greetings!
On Wed, 2010-09-01 at 11:30 -0700, Alex Rodriguez wrote:
Greetings,
Given a very simple grammar for a language that only has an 'if'
statement, I would like to be able to parse white space within literal
values. So far, this works (case 1):
if(value=='white
Greetings!
On Thu, 2010-10-14 at 09:31 -0300, Leonardo K. Shikida wrote:
Hi Kevin
You´re right. So I´ve changed the grammar to include a stopword (semicolon).
Still the same problem.
1-1+1; generates a NoViableAltException
very strange...
while
1+1-1; does not
This is very
Greetings!
On Sun, 2010-10-24 at 02:35 -0700, Trevor John Thompson wrote:
I have a language in which one expression may immediately follow another. I
am trying to construct an AST with an imaginary node representing the
concatenation operator. I want the moral equivalent of
expr: term (SP^
On Tue, 2010-10-26 at 20:07 -0700, Trevor John Thompson wrote:
Greetings.
I continue to wrestle with rewrite rules for AST construction. I am trying to
treat semicolon and newline as equivalent separators, and gather a sequence
of expressions as children of a single AST node. The grammar
Greetings!
On Wed, 2010-11-03 at 22:40 +, Colin Yates wrote:
Hmmm - I think I might be running into a bug - either in the code or my
understanding (almost certainly my understanding!).
unfortunately i do believe you have mis-understood ANTLR Lexers...
I have created a simple grammar
Greetings!
On Tue, 2010-11-09 at 15:26 +0100, Oliver Zeigermann wrote:
Folks!
This is my grammar
--
SHRASS : '=' ;
SEMI : ';' ;
GT : '';
rule : (GT | SEMI | SHRASS)+ ;
--
I though it should parse
;
into a token stream of
GT GT SEMI
but
Greetings!
On Fri, 2010-11-26 at 23:31 +0100, Michael Bosch wrote:
Hi,
I am trying to parse a language where identifiers can contain
spaces but otherwise spaces need to be ignored. I have a problem
getting the ANTLR tokenizer to do this. My problem can be
reproduced with the following
sometimes, when the necessary look ahead is small and is bounded,
syntactic predicates can be your friend.
see attached.
grammar LexerOnly;
@members {
private static final String [] x = new String[]{
a8 b c = d e23 f,
a1b2c3 = xyz,
a1 2 b
};
public static
Greetings!
On Wed, 2010-12-01 at 16:09 +0100, COUJOULOU, Philippe wrote:
Sorry, the code I posted was not correct. Here is the correct code I wanted
to copy in my previous message (with xxxParameter parser rules referring to
correct parameter value rule):
grammar test;
listOfParameters
Greetings!
On Fri, 2010-12-03 at 07:05 -0800, Daniel Rippel wrote:
I am fairly new to antlr and am running into a basic issue that I can't quite
find the answer for on the wiki and in Parr's book.
Here is my lexer. Greatly simplified of course.
...
CREATE : 'create' ;
...
Greetings!
On Sun, 2010-12-05 at 21:44 +0100, Morten Olav Hansen wrote:
Hi, thanks for your reply.
Sorry if it wasn't clear, but the ordering does not matter.
The rule you proposed is basically what I had before, and as you say,
it allows any number of ps* keywords.
What I meant by
Greetings!
On Sun, 2010-12-19 at 13:43 +0100, Gian Maria wrote:
program: start+;
start : (let | num);
let: LET;
num: NUM;
LET: ('a'..'z')+;
NUM: ('0'..'9')+;
WHITESPACE : ( '\t' | ' ' | '\r' | '\n' )+ {
On Sat, 2011-01-29 at 09:34 -0800, Alan D. Cabrera wrote:
functioncall
: varOrExp nameAndArgs+ - ^(FUNCALL varOrExp nameAndArgs+)
;
generates
(FUNCALL
varOrExp
nameAndArgs1
nameAndArgs2
nameAndArgs3
)
What I need it to do is generate
(FUNCALL
Your grammar does not mention the EOF token. (more below...)
On Wed, 2011-02-02 at 16:18 -0300, Victor Giordano wrote:
Hi there. I am having trouble with the error handling.
I have a grammar for recoignize linear expression. And it works great!.
The grammar for a linear expresion is the
On Wed, 2011-02-23 at 16:37 -0800, Terence Parr wrote:
So I have it working with rewrite rules now:
e : e '.' ID - ^('.' e ID)
| e '.' 'this' - ^('.' e 'this')
| '-' e - ^('-' e)
| e '*' b=e - ^('*' e $b)
| e
Greetings!
On Mon, 2011-03-21 at 10:00 -0700, Hiten R wrote:
Hi All,
ANTLR grammar acts funny when it encounters a TOKEN in a String. How should
I make the ANTLR escape the letter found in the String is not a TOKEN.
Help will be appreciated.
Thanks
Hiten
Example
text_content.txt
On Tue, 2011-03-22 at 16:46 -0400, The Researcher wrote:
FYI
In using Imaginary Node Constructor T[token-ref,text] as documented in
The Definitive ANTLR Reference pg. 176,
the error missing attribute access on rule scope: token-ref was given.
I was able to use T[text] as documented
On Tue, 2011-03-22 at 17:21 -0400, The Researcher wrote:
On Tue, Mar 22, 2011 at 5:14 PM, John B. Brodie j...@acm.org wrote:
On Tue, 2011-03-22 at 16:46 -0400, The Researcher wrote:
FYI
In using Imaginary Node Constructor T[token-ref,text] as documented
in
The Definitive
On Tue, 2011-03-22 at 14:40 -0700, Hiten R wrote:
John/All
I followed 'antlr wiki' example but then it stopped working
completely. Previous way it was complaining about the second line but
after the change it could not get past the first line 'funny boys are
Tom Hardy Donald '.
Greetings!
On Thu, 2011-03-24 at 17:22 +0100, wael sellami wrote:
Hello,
...stuff snipped...
book : ^(BOOKDEF name (xmltag)+)
{
System.out.println(Begin book tag);
System.out.println(END book tag);
};
...snipped...
short answer, place actions properly:
book : ^(BOOKDEF name
{
Greetings!
On Tue, 2011-03-29 at 00:47 -0600, Fabien Hermenier wrote:
Hi
I starting to use ANTLR3 with AntlrWorks 3.4.1 on OS X and I have some
issues with spaces. I've attached a sample antlr file describing my
grammar (see 1st grammar)
I'm trying to test 'litteralRange'. So using the
Greetings!
On Wed, 2011-03-30 at 12:43 +1100, Simon wrote:
Hello all,
I have a grammar that does a rewrite like so:
bracketedBlock
: '{' stmts=statement* '}' - ^(Block $stmts)
;
you are not properly handling the cardinality of the * meta-operator.
try:
bracketedBlock :
Greetings!
On Wed, 2011-05-04 at 12:27 -0400, Jeff Hair wrote:
Hello all,
I have a simple C/JavaScript-style grammar for my interpreter project. Right
now, functions can be called via identifier(), or identifier(param1,
param2). This works fine for simple cases, but in my language functions
Greetings!
On Sat, 2011-05-07 at 10:06 -0400, Todd O'Bryan wrote:
Can anyone explain to me why tabs, spaces, and greater-thans at the
beginning of lines are ending up in TEXT tokens, rather than in INDENT
or QUOTE tokens, as I think they should?
fragment SPECIAL_CHARS
: ('\n' | '[' |
Greetings!
On Tue, 2011-05-10 at 09:14 -0500, A Z wrote:
Hello all,
I have a case where I need to assign an imaginary token the attributes of
a token inside a rule. I tried the below but as expected it does not have
the desired effect.
var_or_function :
identifier
(
LPARAN
You have chosen a rule name that clashes with a Java class name, e.g.
Integer.
Select another name for your current Integer lexer rule.
In my opinion this is not an ANTLR problem, rather it is a user error.
On Sat, 2011-05-14 at 23:45 +0200, Dominik Halfkann wrote:
Here are the generated java
Greetings!
On Sun, 2011-05-15 at 16:11 +0200, Bart Kiers wrote:
Hi Philip,
You can't since aParserToken will be initialized as a
org.antlr.runtime.Token type.
You will have to do it (the hard way) like this:
parserRule0
: ( parserRule1
Greetings!
On Mon, 2011-05-16 at 09:43 +0200, Ben Corne wrote:
Hi
Below an example of me trying to use fragment lexer rules to use in rewrite
rules. But when I try this out in the interpreter:
- 'test bar', with a fragment rule AGTEST conflicting with reading 'test',
doesn't parse
-
Greetings!
On Tue, 2011-05-17 at 15:44 +0200, Ben Corne wrote:
Found it in the definitive antlr guide: adding a ? behind $docs did the
trick.
actually i think you want a * in the rewrite expression.
test with 2 or more documentation constructs
2011/5/17 Ben Corne ben.co...@gmail.com
Greetings!
On Wed, 2011-06-01 at 18:20 -0700, Omar Mohssen wrote:
hello
i have a problem using the grammar ANSI C ANTLR v3 grammar (on the link
http://www.antlr.org/grammar/1153358328744/C.g)
the problem is that i couldn't find the start state from which i start the
interpreter to test
Greetings!
On Tue, 2011-06-07 at 07:41 -0400, David Smith wrote:
I'm parsing a grammar in which the semicolon on the end of a line is
optional. So two of the statement rules might be:
| (ID GETS expr SEMI) = ID GETS expr SEMI - ^(GETS ID expr SEMI)
| (ID GETS) = ID GETS expr -
On Tue, 2011-06-07 at 10:33 -0400, David Smith wrote:
Yes, the language is Matlab and a semicolon on the end of an
assignment expression suppresses display of the result of the assignment.
Bart, I appreciate the suggestion; I haven't tried that (much
simpler) solution - I'll let you know.
Greetings!
On Wed, 2011-07-06 at 21:19 +0200, Sébastien Kirche wrote:
Hi,
the language for which I am trying to build the grammar has 2 flavors
of if-then-else constructs
- a single line : if condition then statement [else statement]
- a multi line : if condition then statements [else
see attached.
I, also, am available for hire, if you should opt for that...
-jbb
On Thu, 2011-07-07 at 01:27 +0200, Sébastien Kirche wrote:
Le 7 juillet 2011 00:14, John B. Brodie j...@acm.org a écrit :
Greetings!
[...]
unable to reproduce.
given your admittedly partial
Greetings!
On Thu, 2011-07-07 at 17:04 +0200, Sébastien Kirche wrote:
Le 7 juillet 2011 05:08, John B. Brodie j...@acm.org a écrit :
see attached.
Many, many thanks, as your corrections on my example helped me
considerably and the initial recursion is gone.
you are welcome. i actually
Greetings!
On Thu, 2011-07-14 at 16:11 -0700, Roy Metzger wrote:
Hi all,
Let's say I have something like this:
rule: ( 'stuff' e1=expression)?
statement
('stuff' e2=expression)? ;
Now, I would like to know is there a way to dynamically flip rules on/off.
For example, when
e1 is
Greetings!
On Sat, 2011-07-16 at 05:03 +1100, Minhaz Zibran wrote:
I am trying to learn ANTLR. I tried to invoke ANTLR v3.3 from
command line (java -cp antlr-3.3-complete.jar org.antlr.Tool T.g) on
the T.g, and found the following error message:
error(10): internal
Greetings!
On Mon, 2011-07-18 at 15:35 -0500, Dejas Ninethousand wrote:
Hello,
If I have the rule:
text : t=(UNQUOTED_ALPHA_TEXT | DECIMAL_NUMBER)+ {
stack.pushUnquotedText(...); };
Is there any way for me to gather the text of all the ALPHA_TEXT and
DECIMAL_NUMBER tokens in
Greetings!
On Thu, 2011-07-21 at 14:53 +0200, Roland Sako wrote:
Hello,
I am Roland Sako from Geneva in Switzerland. I am currently working on a
project which I need to generate an expression tree
of an Objective-C source code, then I will visit that tree to add extra
instruction in it.
Greetings!
On Tue, 2011-08-02 at 23:11 +, Scott Smith wrote:
I assume this is the proper place to put this. I'm trying to build a parser
for filters generated by SOLR (lucene.apache.org).
i think this is exactly the correct place to post questions of this
kind.
Examples of valid
On Fri, 2011-08-05 at 01:15 +, Scott Smith wrote:
I have created a parser/lexer. When I run it as a standard parser (no ASTs),
it runs fine. I've verified with the debugger, that it generates a
reasonable tree.
But, I want to run it to generate ASTs. So, I modified the code to do
On Mon, 2011-08-08 at 19:41 +, Scott Smith wrote:
I am writing a grammar to generate ASTs. There are operators called AND
and OR (defined in the lexer) in the language. I want my parser to produce
ASTs that group together all of the terms which are using the same operator.
Also,
I do not use Fedora; rather I use the jar file downloaded from antlr.org
on Ubunto 11.04 with proper CLASSPATH setting.
So my suggestion may be way off base...
On Tue, 2011-08-09 at 11:41 -0400, The Researcher wrote:
I am test building ANTLR on Fedora 15 and installed package antlr3-tool
using
Sorry for jumping in where i may not belong
On Wed, 2011-08-10 at 16:09 -0400, David Smith wrote:
Sam,
I understood the answer, but we're talking novice here - if the front
end of my grammar looks like this:
prog: body EOF!
;
body:
parts - ^(BODY parts)
Greetings!
On Thu, 2011-08-25 at 16:00 +0400, Романов Артем wrote:
grammar formulaGrammar;
options{
backtrack=true;
}
formula : expr ;
expr : atom ( OPERATOR expr )*
| '(' expr ( OPERATOR expr )* ')' ;
atom : ( NUMBER | ID | function ) ;
function:
Greetings!
This is just off the top of my head, so is probably a bogus answer.
On Thu, 2011-09-01 at 19:26 -0500, Dejas Ninethousand wrote:
I have this entry in my grammar file:
@members
{
@Override
public void displayRecognitionError(String[] tokenNames,
RecognitionException e)
{
Greetings!
Have you looked at the Java grammar in the v3 example suite?
also
On Thu, 2011-09-08 at 18:08 +, janet.hurw...@usc-bt.com wrote:
Hello- I'm working on a grammar that needs to support embedded blanks in
strings: identifier=two words
The interpreter keeps breaking at 'two'
Greetings!
On Fri, 2011-10-07 at 11:45 -0700, mglyons wrote:
I am trying to build the grammar for a small language, C-. I am getting a
long list of errors and am unable to resolve them with google and my
textbook after almost a day of trying.
Here is my grammar:
Here is the list of
On Fri, 2011-10-07 at 13:16 -0700, mglyons wrote:
Thanks for the quick response John B.
In the pdf I have that is instructing how to write this grammar it says
this:
/The keywords of the language are the following:/
*else if int return void while*
/All keywrods are reserved, and must
On Fri, 2011-10-07 at 16:22 -0700, mglyons wrote:
Thanks again! I did what you said and also figured out how to do some
left-factoring. I had to fix 3 left-factoring issues and resolved two of
them. This one I cannot seem to figure out:
*expr : var '=' expr | simple_expr;*
I do
On 11/07/2011 12:32 PM, Jim Idle wrote:
Better to do this:
fragment FLOAT;
INT : '0'..'9'+ ( '.' '0'..'9'+ { $type = FLOAT; } | ) ;
and of course the above REQUIRES at least one digit to the left of the
decimal place on FLOAT. which is not what the OP had. but is easily
fixed, i believe, as:
Greetings!
On 11/11/2011 03:00 AM, D. Frej wrote:
The grammar is rather stupid and simple
... snipped ...
It is executed with the following Java code
ANTLRStringStream input = new ANTLRStringStream(15 / 7.25 +4);
ExpressionLexer lex = new ExpressionLexer(input);
CommonTokenStream tokens =
Greetings!
I think you have issues with your function, number, and ATOM rules. see
below...
I have attached my complete, modified, grammar that successfully parses
your input sample.
On 11/14/2011 11:47 PM, Jarrod Roberson wrote:
I am trying to write a parser for the following syntax
Greetings!
First 2 caveats then see discussion below:
1) I do not know C#. all of my suggestions are based on the Java target.
2) My suggestions are from memory. I have not actually tested them (or
rather I have tested them in the past on other problems and hope memory
works).
On 11/15/2011
On 11/16/2011 12:02 AM, Voelkel, Andy wrote:
array: '[' FLOAT+ | STRING+ ']' - ^(ARRAY FLOAT+ STRING+) ;
the separate lists on the right of the - work because your syntax
specifies separate lists.
[Andy - this approach doesn't work - I get exceptions thrown. I haven't
debugged that
1 - 100 of 101 matches
Mail list logo