yes, i have, it has a prog_return class in the code, but it isnot the String
type,do you know how can I take the value as a string out of the code?
2008/11/23 Terence Parr <[EMAIL PROTECTED]>
>
> On Nov 23, 2008, at 7:47 PM, Su Zhang wrote:
>
> Hi all,
>>
>> I wrote a returns [String s] in my rul
On Nov 23, 2008, at 6:24 PM, George S. Cowan wrote:
> Why is it that I can't search the antlr-interest archive from
> http://www.antlr.org/wiki/dashboard.action
> but I can search stringtemplate-interest?
>
> Is there a place where I can search the antlr-interest archive?
hi. sure. in the supp
On Nov 23, 2008, at 7:47 PM, Su Zhang wrote:
> Hi all,
>
> I wrote a returns [String s] in my rules in order to get a return
> value, but when I call the function generated by the exact rule in
> the main function, there is not any return value, and the type of
> return value is not a Stri
Hi all,
I wrote a returns [String s] in my rules in order to get a return value, but
when I call the function generated by the exact rule in the main function,
there is not any return value, and the type of return value is not a String,
and the value includes a tree structure,etc, but I define it
Hi George,
Also don't forget to download the intermediate release
gunit-1.0.4.jar I just uploaded to the wiki download page.
The new version should be able to test your lexical rules as the
example demonstrates on wiki.
Please let me know if you find any problem.
Thanks.
Leon
On Nov 23, 2008
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
Leon,
I saw your gUnit changes at
http://www.antlr.org/wiki/display/ANTLR3/gUnit+-+Grammar+Unit+Testing
Thanks. That was a swift response.
I'll start using gUnit on my project and let you know if I see any problems.
On Mon,
Why is it that I can't search the antlr-interest archive from
http://www.antlr.org/wiki/dashboard.action
but I can search stringtemplate-interest?
Is there a place where I can search the antlr-interest archive?
List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe:
MismatchedRangeException's description is:
The recognizer tried to match a range of symbols, usually characters, but
could not. It tracks the minimum and maximum element in the range.
I try to find what situation MismatchedRangeException be raised.
My grammar is :
number : Digital+;
Digital : '
So in my grammar, I capture blocks of JSON-like structures. I don't
want antlr to try to parse that structure, but rather to evaluate it
as a string.
Here is a sample code...
define project as {
"name": "some_widget",
"version": "0.01-alpha"
}
Here is a simple grammar rule to demonstr
thanks a lot, yet there still have a minor problem in my project, when I am
trying to get a return value from the program, I called in the main
function,but I cannot find get the return value, does anybody see problem
in my grammar?
here it is:
numreturns [String t]
:n = Num {$t =
$n
Hi all,
I encountered a very strange problem. I put a string 'read' in the grammar
code, and when matching, I would like the input to match the toke ID which
is defined as ('a'..'z'). Obviously, the IDshould match read, but why it
cannot match, just becasue I have a hardcoded string 'read' in the g
Hi,
I'm also a newbie (thus everything could be wrong) so I can't help that
much... But anyway:
Here is a edited Expr grammar:
grammar Expr;
options {
output=AST;
ASTLabelType=CommonTree;
k = 1;
}
prog:(stat {System.out.println($stat.tree.toStringTree());} )+ ;
stat:
2008/11/18 James Abley <[EMAIL PROTECTED]>:
> Hi all,
>
> Sorry, I'm still stuck with this. I have taken the sample grammar from
> the book and reduced it as small as I know how currently.
>
>
> grammar Expr;
>
> options {
>output=AST;
>ASTLabelType=CommonTree;
>k = 1;
> }
Hi Gavin
but the class cannot be applied by the outside source, right? then how can
get the value out of the program? i mean i want to call the function in the
main function, yet it is generated in the internal class of the parser
class, right? then how can i get this value in the main fuction?
t
2008/11/23 Gavin Lambert <[EMAIL PROTECTED]>:
> At 08:11 24/11/2008, Simon wrote:
> >But I've just realized that without access to the referenced
> >classes (source or binary form) it is still not possible to
> >do that.
> >
> > a.b.c.D.X.z()
> >
> >Where does the class name end and the fi
At 06:52 24/11/2008, Su Zhang wrote:
>My program needs a string from Parser, but there is not any
>function provided in the public class parser, how can I get the
>string outside? I mean I want to get the string generated from
>the rules of antlr(functions in parser), and I have
>written "ret
At 08:11 24/11/2008, Simon wrote:
>But I've just realized that without access to the referenced
>classes (source or binary form) it is still not possible to
>do that.
>
> a.b.c.D.X.z()
>
>Where does the class name end and the field access start?
>There is simply no way to answer that ques
Hi
I'm aware that it is not possible to do this without context. That's
why I keep symbol tables, all imports, ... at hand to handle those
situations. Using semantic predicates it should be possible to build a
meaningful AST (that is an AST with subtree nodes representing
operations such
Hi Simon,
I guess that would not be possible. Consider the following two cases,
class A {
static b b;
}
class b {
static String bField;
public static void main(String[] args) {
A.b.bField ="s";// "A" is the
type, "b.bField" field access
Hi all,
My program needs a string from Parser, but there is not any function
provided in the public class parser, how can I get the string outside? I
mean I want to get the string generated from the rules of antlr(functions in
parser), and I have written "returns[String s]" to indicate that I nee
Simon schrieb:
> I try to rephrase my question. I don't know how to handle some of the
> primary constructs of the Java grammar.
>
> Integer.parseInt("123")
> x.y(a, b)
> x[12][34]
> String.class
> java.util.Arrays.class
>
> are all pretty simple to detect with a symbol table and the
I try to rephrase my question. I don't know how to handle some of the
primary constructs of the Java grammar.
Integer.parseInt("123")
x.y(a, b)
x[12][34]
String.class
java.util.Arrays.class
are all pretty simple to detect with a symbol table and the
information from the imports. Bu
Hi Gavin,
in general, a good idea. This would simplify the parser. But what's
about the walker? After splicing the ASTs, the walker has to expect an
^(comment ...) subtree everywhere (or at least after / before every
statement).
Is it possible to let the walker walk two ASTs? Synchronizatio
At 07:39 23/11/2008, Chris Sekszczynska wrote:
>Now I like to write all comments occurring in the source file to
>the (nearly) same position in the destination file. So I have to
>pass the comments to the walker. Of cause, I could simply put the
>comments into the default token stream and add "
Hello,
All the documentation provided with Antlr concentrate on the grammar and tree
construction (understandably).
I'm working on developing a small interpreter, and will use one of the grammars
in the examples with modifications.
However, I couldn't find any grammar example ready with acti
25 matches
Mail list logo