Ter,
This is an issue that enough of us run into and eventually figure out how to
hack around. I honestly can't remember if it's covered in the First Book, but
might this be a candidate for inclusion in a later edition, a kind of
anti-pattern to be on the lookout for?
_
> I tried using a rule like ^( BLOCK .* ASSIGN ASSIGN .* ), but that didn't
> seem to work.
I've recently discovered that .* on the end doesn't seem to work too well. I
think I tried .+ or was it .* followed by UP...no, i think it was ~UP*. I need
to fix this.
Ter
I just tried all of those, t
Hi gang,
I'm having a bit of trouble with a tree filter. I'm trying to take ASSIGN
trees like this:
^( ASSIGN ID expr )
and merge them together whenever they are adjacent to each other in a tree
under a BLOCK node. So, bigger example:
^( BLOCK
^( foo ... )
^( ASSIGN ID expr )
^(
Howdy,
Is there any reason that the default downup() prints out all the
transformations it makes? Is this perhaps something that will be turned into
an option in 3.2? (The default implementation is more than adequate, except
for that little detail.)
--S
--~--~-~--~~~
Hi,
In cases like this, I prefer not to jump through the parsing hoops that
Python-style whitespace requires. Instead, I write a preprocessor (in Perl,
usually) that adds extra tokens to the source file, making the whitespace
irrelevant again.
To modify your example, I would take
%A
%B
I might not be understanding how you want them both to be binary operators.
But what if you have two different tokens for each operator, eg. 'X' and 'X
NOT', and treat them as different operators?
--- On Mon, 7/13/09, Jennifer Cooper wrote:
From: Jennifer Cooper
Subject: [antlr-interest] two
Hi gang,
(BTW, is there a different mailing list for ANTLRWorks questions?)
If not, I'm having a bit of trouble with breakpoint debugging. I saw an item
in a version's release notes saying that you could set a breakpoint on the
input text or in the grammar. I figured out how to do the input t
And if it doesn't, you can try the more explicit variant:
code : (p+=proc | f+=func)*
-> ^(CODE ^(PROCS $p*) ^(FUNCS $f*))
;
(Or leave out the PROCS/FUNCS nodes if you just want to reorder the
procedures/functions without actually grouping them in a subtree.)
The Real World interfered for a
Hi Damien,
> doesn't something like this work?
>
> code: procs* funcs*
> -> ^(CODE ^(PROCS procs*) ^(FUNCS funcs*))
>
I don't think it would, because it still requires that procs be grouped
together in the source code, as well as funcs. Something like
code: (proc | func)*
would be
Hi gang,
Here's a question for you. (Apologies if this is explained somewhere; I
haven't found it yet.) Suppose I have a language where I have procedures and
functions (Oh! Pascal!), such as this:
procedure a() { ... }
function x() { ... }
procedure b() { ... }
function y() {
I think Waverly's point wasn't the complexity of the grammar of the language.
No one is arguing the simplicity of the Smalltalk grammar. His point was that
compiling a simple imperative language to LLVM will demonstrate the basics of
LLVM IL generation. "Everyone knows C", so it should make
Finally got around to trying this and it worked like a champ. Thanks, Ter.
--- On Tue, 6/2/09, Terence Parr wrote:
From: Terence Parr
Subject: Re: [antlr-interest] Tree grammar example, redux
To: "J. Stephen Riley Silber"
Cc: antlr-inter...@antlr.org
Date: Tuesday, June 2, 2009, 4:
Oh, I'm saying you wouldn't want to use a grammar at all. The problem you've
described is lexical, not grammatical. If you simply want to break apart a
line of text based on an arbitrary delimiter, it would be much easier to write
a program in Perl, Python, Java, etc. that split the text based
Howdy,
I'm guessing there's more to the problem than just supporting arbitrary field
separation tokens, because if that's all there is, just use something like perl
and store the separator(s) in a config file...?
--S
--- On Sun, 6/7/09, Dukie Banderjee wrote:
From: Dukie Banderjee
Subject:
Indeed! But then, *we* don't want to limit you to 350 pages, either! :-)
--- On Fri, 6/5/09, Terence Parr wrote:
From: Terence Parr
Subject: Re: [antlr-interest] "Language design patterns" book available in beta
To: "Edwards, Waverly"
Cc: "antlr ANTLR"
Date: Friday, June 5, 2009, 4:15 PM
H
No brainer. Be terse with the example code, but have it all downloadable
online. Please do NOT skimp on the pattern explanations! That's where this
book is strongest.
For example, the top-down and bottom-up tree rewriting stuff on antlr.org? I
really didn't understand why some things should
Wow, Christian, tell me how you convinced your company to let you do this. I
tried to get a company to use a DSL to make their custom app development about
50 times more efficient, but to no avail. They literally thought things like
"inventing a human-usable language" was impossible, and inste
Parr
Subject: Re: [antlr-interest] "Language design patterns" book available in beta
To: "J. Stephen Riley Silber"
Cc: "String Template Mailing LIst" , "antlr
ANTLR"
Date: Thursday, June 4, 2009, 1:09 PM
I do actually have a write up from a prototype of the
May I request less "hoping" and more "doing"? Because llvm stuff would be
AWESOME. An approachable example would be so very Rosetta Stone-ish.
--- On Thu, 6/4/09, Terence Parr wrote:
From: Terence Parr
Subject: Re: [antlr-interest] "Language design patterns" book available in beta
To: "ugol
Whoo! I just downloaded my beta! (Don't spend all that royalty money in one
place!) I'm very excited about this book. Congratulations, Ter, and thanks!
--S
--- On Wed, 6/3/09, Terence Parr wrote:
From: Terence Parr
Subject: [antlr-interest] "Language design patterns" book available in bet
Hi gang,
Frank mentioned the second example in this article
(http://www.antlr.org/wiki/display/ANTLR3/Simple+tree-based+interpeter) not
working as of 3.1.3. I, too, have been trying to get it working, to no avail.
Did something fundamental change in the TreeNodeStream functionality? I like
t
Oh, Ian, you have to be careful with posts like that. Terence is very sneaky
like that. :-)
--- On Tue, 6/2/09, Terence Parr wrote:
From: Terence Parr
Subject: Re: [antlr-interest] ocaml target?
To: "Ian Eyberg"
Cc: antlr-inter...@antlr.org
Date: Tuesday, June 2, 2009, 12:31 PM
On Jun 2,
22 matches
Mail list logo