[il-antlr-interest: 24504] Re: [antlr-interest] Ambiguous grammar or Antlr?

2009-07-02 Thread Gary R. Van Sickle
essentially the former as an example of why LL(*) makes it so you don't have to do a manual refactoring such as the latter. In fact, that section makes the argument that one should *not* do the left-factoring manually, if for no other reason than to maintain the readability of the gramma

[il-antlr-interest: 23986] [antlr-interest] Is the parenthesis node duplication bug fixed yet?

2009-06-02 Thread Gary R. Van Sickle
is doesn't: pointer : (lc='*' type_qualifier?)+ -> ^(POINTER[$lc, "POINTER"] type_qualifier?)+ ; Does the latter work in the latest snapshots? Thanks, -- Gary R. Van Sickle List: http://www.antlr.org/mailman/listinfo/antlr-interest

[il-antlr-interest: 23900] Re: [antlr-interest] Unnecessary Java output file diffs

2009-05-27 Thread Gary R. Van Sickle
Nerd Points. += 1,000,000 points if that's actually what he meant. ;-) -- Gary R. Van Sickle List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~-~--~~~---~--~-

[il-antlr-interest: 23854] Re: [antlr-interest] Rewrite a list to a set of trees

2009-05-22 Thread Gary R. Van Sickle
> At 17:58 22/05/2009, Gary R. Van Sickle wrote: > >var_decl_list > >: TYPENAME ids+=IDENTIFIER (',' ids+=IDENTIFIER)* -> ^(VAR_DECL > >TYPENAME IDENTIFIER)+ > >; > > > >If your rule can't be reduced to a one-liner like

[il-antlr-interest: 23851] Re: [antlr-interest] Rewrite a list to a set of trees

2009-05-21 Thread Gary R. Van Sickle
NTIFIER)+ ; If your rule can't be reduced to a one-liner like that though (e.g. C declarations), things quickly get complicated, and I've yet to determine a good, general way of handling it. You'll probably want to look into ANTLR

[il-antlr-interest: 22979] [antlr-interest] 3.1.4 + C runtime: Imaginary tokens lost their names?

2009-04-02 Thread Gary R. Van Sickle
p there is an imaginary token that I can't do the "$lc" thing to because they derive from nonterminals. This is using "ANTLR Parser Generator Version 3.1.4-SNAPSHOT Mar 31, 2009 24:26:37" and the latest 3.1.3 C runtime. Any idea what's going wrong? Is it me or ANTLR?

[il-antlr-interest: 22841] Re: [antlr-interest] Bug report; generated C(++) code inappropriately initialises non-primitive return values

2009-03-30 Thread Gary R. Van Sickle
for return values (declaration only), and not encountered any > issues in my grammars thus far. > > Richard Like I noted above, you will run into problems due to the malloc() vs. new thing. At least I did the last time I tried it. -- Gary R. Van Sickle List: http:

[il-antlr-interest: 22774] Re: [antlr-interest] 3.1.3 only accepts *.g extensions

2009-03-25 Thread Gary R. Van Sickle
e. Custom build rules are done on a > per-target basis (which sucks, I'll admit), you have to > specify an expression to match the filename, you provide a > script to do the work, and you specify output files. > Similar issue with bog-standard makefiles. Though like anythi

[il-antlr-interest: 22723] [antlr-interest] 3.1.3 only accepts *.g extensions

2009-03-24 Thread Gary R. Van Sickle
-- Gary R. Van Sickle List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[il-antlr-interest: 22636] Re: [antlr-interest] proposal: make .* and .+ always nongreedy

2009-03-22 Thread Gary R. Van Sickle
27;t see the rationale stated anywhere). This way the existing syntax and semantics stay the same, so nobody's existing parsers get broken, and by adopting the same syntax/symantics of Perl regexes, we creep ever closer to the day when we can all use these glorious regexes in our ANTLR l

[il-antlr-interest: 22343] [antlr-interest] On "How to remove global backtracking"

2009-03-08 Thread Gary R. Van Sickle
" that this could be reduced in the input grammar? Even if "L" here is not a terminal but is intended to be either a terminal or non-terminal, aren't these two variations in all cases exactly equivalent? -- Gary R. Van Sickle List: http://www.antlr.org/mailman/listinfo/antlr-inte

[il-antlr-interest: 22173] [antlr-interest] ^(TOKEN) vs. TOKEN

2009-02-28 Thread Gary R. Van Sickle
ppear to work: pointer : POINTER ; But it's not clear to me why this should be so. Shouldn't both these cases share the same syntax, either both ^(POINTER) or both POINTER? Thanks, -- Gary R. Van Sickle List: http://www.antlr.org/mailman/listinfo/antlr-inte

[il-antlr-interest: 22154] Re: [antlr-interest] More label breakage?

2009-02-28 Thread Gary R. Van Sickle
matches what's on page 134 of the ANTLR book. So, never mind. -- Gary R. Van Sickle > -Original Message- > From: antlr-interest-boun...@antlr.org > [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Gary > R. Van Sickle > Sent: Saturday, February 28, 2009

[il-antlr-interest: 22153] [antlr-interest] More label breakage?

2009-02-28 Thread Gary R. Van Sickle
en? If I comment out the action, it gets through ANTLR and compiles, but of course that's of little use. Apparently ANTLR is looking for something along the lines of "new If(NULL, $something::s1, $something::s2)", but I have no idea what $something is supposed to be, nor can I fin

[il-antlr-interest: 22152] Re: [antlr-interest] Bug in ANTLR-3.1.2 with tree grammar wildcard list label x+= ?

2009-02-27 Thread Gary R. Van Sickle
; > > And then use p+=content in your original rule. Bug or feature though? It seems inconsistent for what appear to be two semantically equivalent constructs to be totally fine in the one case and a silent failure in the other. -- Gary R. Van Sickle List: http://www.antlr.org/mai

[il-antlr-interest: 22037] Re: [antlr-interest] void* conversion in C runtime

2009-02-22 Thread Gary R. Van Sickle
nal_declaration)>->free(SCOPE_TOP(external_declaration)); } Not quite sure what's going on there, but in the first case it looks like there's one too few "-"'s and in the second one too many ">"'s before the "free". -- Gary R. Van Sic

[il-antlr-interest: 21996] [antlr-interest] Bug in Imaginary Node Constructors

2009-02-18 Thread Gary R. Van Sickle
sing an "lc=" anywhere. When the resulting parser is run, it segfaults. Seems to me that ANTLR should refuse to compile this. -- Gary R. Van Sickle List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.

[il-antlr-interest: 21880] [antlr-interest] Labels broken?

2009-02-11 Thread Gary R. Van Sickle
: Unexpected token, at offset 12 near [Index: 6 (Start: 8980854-Stop: 8980870) ='THIS_IS_A_TYPEDEF', type<39> Line: 2 LinePos:12] : syntax not recognized... Doing "ds=" results in the same problem. Am I misunderstanding something, or is this breakage? -- Gary R. Van

[il-antlr-interest: 21672] Re: [antlr-interest] Theading Tree Walkers

2009-02-02 Thread Gary R. Van Sickle
structs used for these purposes are malloc()'ed, hence no object construction. Hmmm "#ifdef __cplusplus // We're being compiled as C++ NEW_SCOPE new ScopeStruct() #else // We're in C NEW_SCOPE malloc(sizeof(ScopeStruct)) #endif ScopeStruct the_scope = NEW_SCOPE

[il-antlr-interest: 21655] Re: [antlr-interest] adding "version" option to ANTLR grammars

2009-02-01 Thread Gary R. Van Sickle
s aren't able to read release notes yet, nor are they in general able to divine the version of a language the original source was written to. Until they somehow magically grow both these abilities, everybody wins if such information is explicitly communicated by the writer to the tool. > S

[il-antlr-interest: 21646] Re: [antlr-interest] adding "version" option to ANTLR grammars

2009-01-31 Thread Gary R. Van Sickle
> From: Anthony W. Youngman > > In message <673774b77dfb453c985a9d7053ec2...@dfw5rb41>, Gary > R. Van Sickle writes > >> Another improvement would be to allow a comma-separated list. > >> With it one can record all versions of ANTLR, with which &

[il-antlr-interest: 21610] Re: [antlr-interest] Optimizations of tree rewriting in C target

2009-01-28 Thread Gary R. Van Sickle
;-) PLease make sure > that the build you download includes these changes, which it > should be build #20 for the C runtime and build #49 for the > ANTLR Tool. > > Jim > - - - - - > Can't speak to the speed, but the Pop() thing is solved here. Thanks

[il-antlr-interest: 21567] Re: [antlr-interest] C Target bug fixes

2009-01-25 Thread Gary R. Van Sickle
97 ): undefined reference to `_pcompound_statement_SymbolsPop' collect2: ld returned 1 exit status make: *** [all] Error 1 -- Gary R. Van Sickle List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/ant

[il-antlr-interest: 21566] Re: [antlr-interest] C Target bug fixes

2009-01-25 Thread Gary R. Van Sickle
t; and so on all within the jar. You can tehrefore run it > without CLASSPATH as: > > jar -jar path/to/jar-with-dependencies.jar t.g ^^^ java -jar [etc] -- Gary R. Van Sickle List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/o

[il-antlr-interest: 21481] Re: [antlr-interest] C target, C grammar + AST = missing *_SymbolsPop()

2009-01-21 Thread Gary R. Van Sickle
tion_unit_return translation_unit() throws RecognitionException { Symbols_stack.push(new Symbols_scope()); [...] finally { [...] Symbols_stack.pop(); } return retval; } // $ANTLR end "translation_unit" -- Gary

[il-antlr-interest: 21459] Re: [antlr-interest] C target, C grammar + AST = missing *_SymbolsPop()

2009-01-20 Thread Gary R. Van Sickle
icated with "ANTLR Parser Generator Version 3.1.2-2008-10-21" and libantlr3c-3.1.2.b1.tar.gz from here: <http://www.antlr.org/hudson/job/ANTLR%20C%20Runtime/lastSuccessfulBuild/art ifact/libantlr3c-3.1.2.b1.tar.gz> Is there something else I can do to try help debugging this? -- G

[il-antlr-interest: 21458] Re: [antlr-interest] C target, C grammar + AST = missing *_SymbolsPop()

2009-01-20 Thread Gary R. Van Sickle
AST lines and it builds fine. > > ??? > > > Jim > > Replicated this with "ANTLR Parser Generator Version 3.1.2-2008-10-21" and... I'm not sure which version of runtime, Makefile.am is dated 10/1/08. -- Gary R. Van Sickle List: http://www.antlr.org/mailman/

[il-antlr-interest: 21428] Re: [antlr-interest] adding "version" option to ANTLR grammars

2009-01-20 Thread Gary R. Van Sickle
behaviour or the use of a new feature), the list is cleared. How do you do that once your grammar leaves your PC? Your customer decides to upgrade his ANTLR install and now your program won't compile. > And if someone is unsure if a grammar change makes things > incompatible, he has to chec

[il-antlr-interest: 21426] [antlr-interest] C target, C grammar + AST = missing *_SymbolsPop()

2009-01-20 Thread Gary R. Van Sickle
s work fine if I don't declare "output=AST"; in that case, the only SymbolsPop() function generated or called appears to be pss9_combined_lexer_parserParser_SymbolsPop(), i.e. all dynamic scope code calls the same ScopePop(). Does this ring any bells for anybody? -- Gary R. Van Sickle

[il-antlr-interest: 21414] Re: [antlr-interest] adding "version" option to ANTLR grammars

2009-01-19 Thread Gary R. Van Sickle
;; > } > FWIW, when I become King Of The World, all languages will require such an indication of what version they were written for. -- Gary R. Van Sickle List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr

[il-antlr-interest: 21211] Re: [antlr-interest] Please provide fix for the errors in STDC Grammar

2009-01-08 Thread Gary R. Van Sickle
9/C0x constructs. I ran into this one myself, and temporarily got around it by simply "absorbing" anything that looked like "__extension__ ( )". > > 3: > > Token *pToken = __builtin_va_arg(ap, Token*); > Same thing here, __builtin_va_arg() is a GCC built-in that

[il-antlr-interest: 21172] Re: [antlr-interest] Dynamic scopes, pANTLR3_COMMON_TOKEN, and the C runtime

2009-01-03 Thread Gary R. Van Sickle
ression::root} {$te.root_identifier}) tree_expression // This handles everything else. | IDENTIFIER -> ^(ASSOCIATION {$tree_expression::root} IDENTIFIER) ; //@} Are there better or more succinct ways to do what I'm trying to do here? -- Gary R. Van Sickle > -Ori

[il-antlr-interest: 21171] [antlr-interest] Dynamic scopes, pANTLR3_COMMON_TOKEN, and the C runtime

2009-01-03 Thread Gary R. Van Sickle
//@} I have an analogous construct in a different part of my grammar which does this same thing with a pANTLR3_BASE_TREE, with no observed ill effect. -- Gary R. Van Sickle List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr

[il-antlr-interest: 21159] Re: [antlr-interest] Problem with disambiguating semantic predicates and the decision DFA

2008-12-31 Thread Gary R. Van Sickle
rrent "lex 'em all and let the parser sort 'em out" lexer implementation used by ANTLR results in a system which needlessly suffers the limitations involved with the top-down approach and prevents it from taking advantage of some of the benefits. Idle New Years' Eve thinking-out-lo

[il-antlr-interest: 21122] Re: [antlr-interest] Building an HTTP parser

2008-12-29 Thread Gary R. Van Sickle
omplex and/or sloppy the specification of the language in question is. Parsing HTML with tools such as ANTLR should be a relatively straightforward endeavor. > Any suggestions, advice or pointers gladly appreciated! > Thanks, > Tom Hope this helps Tom. -- Gary R. Van Sickle List: http:

[il-antlr-interest: 21120] Re: [antlr-interest] Location dependent token?

2008-12-29 Thread Gary R. Van Sickle
EUR' ; TNE : 'TNE' ; Parser does something like this: num_with_monetary_unit_and_optional_per_unit : NUMBER monetary_unit ('/' measurement_unit)? ; monetary_unit : EUR | <> ; measurement_unit : TNE | <> ; But was that really your question? -- G

[il-antlr-interest: 21085] Re: [antlr-interest] Match the start and end of a line

2008-12-25 Thread Gary R. Van Sickle
> From: Gavin Lambert > > At 22:17 25/12/2008, Gary R. Van Sickle wrote: > >translation_unit > >: (BOL statement EOL)+ > >; > > > >You'd have to be throwing up WS tokens as well though for > >that to be buying you anything. > &

[il-antlr-interest: 21083] Re: [antlr-interest] Match the start and end of a line

2008-12-25 Thread Gary R. Van Sickle
L implies a BOL (beginning of line) immediately after it, so "simply" emit both an EOL and a BOL token from the ('\r'|'\n')+ match in the lexer, then make your parser rules look like this: translation_unit : (BOL statement EOL)+ ; You'd have to be throwin

[il-antlr-interest: 21078] [antlr-interest] Merry Xmas Terence!

2008-12-24 Thread Gary R. Van Sickle
about things like Java: "$id.text" => C: "$id.text->chars", maybe in nice tables, one for each "Java Target => LanguageX Target" mapping. I know this may be a quickly moving target, so maybe make it a web-only thing and direct people to it in the book. Here'

[il-antlr-interest: 21033] Re: [antlr-interest] Flattening lists?

2008-12-20 Thread Gary R. Van Sickle
> From: Jim Idle > > On Mon, 2008-12-15 at 08:44 -0600, Gary R. Van Sickle wrote: > > > Hi all, > > Not sure if this is something that should be obvious or > not, but is there a > way, completely in ANTLR 3.x (C backend

[il-antlr-interest: 20938] [antlr-interest] Flattening lists?

2008-12-15 Thread Gary R. Van Sickle
t varA) (VAR_DECL int varB) (VAR_DECL int varC) Of course once I have the AST I can traverse it with C &&/|| C++, but it would sure be nice if ANTLR was able to flatten these sort of constructs for me. Thanks, -- Gary R. Van Sickle List: http://www.antlr.org:8080/mailman/listinfo

[il-antlr-interest: 20798] Re: [antlr-interest] C runtime const correctness

2008-12-02 Thread Gary R. Van Sickle
> From: Jim Idle > > On Mon, 2008-12-01 at 22:17 -0600, Gary R. Van Sickle wrote: > > > Shouldn't this: > > ANTLR3_API pANTLR3_INPUT_STREAM > antlr3AsciiFileStreamNew(pANTLR3_UINT8 > fileNam

[il-antlr-interest: 20780] [antlr-interest] C runtime const correctness

2008-12-01 Thread Gary R. Van Sickle
Shouldn't this: ANTLR3_API pANTLR3_INPUT_STREAM antlr3AsciiFileStreamNew(pANTLR3_UINT8 fileName); Really be this: ANTLR3_API pANTLR3_INPUT_STREAM antlr3AsciiFileStreamNew(const pANTLR3_UINT8 fileName); ? -- Gary R. Van Sickle List: http://www.antlr.org:8080/mailman/listinfo/

[il-antlr-interest: 20759] Re: [antlr-interest] ANTLR installation/use on Unix

2008-11-30 Thread Gary R. Van Sickle
> From: Jim Idle > > On Sun, 2008-11-30 at 03:06 -0600, Gary R. Van Sickle wrote: > > > > From: Jim Idle > > > > On Fri, 2008-11-28 at 21:28 -0600, Gary R. Van Sickle wrote: > > >

[il-antlr-interest: 20742] Re: [antlr-interest] ANTLR installation/use on Unix

2008-11-30 Thread Gary R. Van Sickle
en able to determine, there simply isn't any support in the distribution for even rudimentary installation and command-line use. See my last post, I'd be more than happy to contribute my solution if there's any interest in it. -- Gary R. Van Sickle List: http://www.antlr.org:8

[il-antlr-interest: 20741] Re: [antlr-interest] ANTLR installation/use on Unix

2008-11-30 Thread Gary R. Van Sickle
> From: Jim Idle > > On Fri, 2008-11-28 at 21:28 -0600, Gary R. Van Sickle wrote: > > > Hi Terence et al, > > Am I just getting old, or shouldn't I be able to (in a > More Ideal World(tm), > of course) do som

[il-antlr-interest: 20715] [antlr-interest] ANTLR installation/use on Unix

2008-11-28 Thread Gary R. Van Sickle
that looks like part of an URL? Am I missing something blindingly obvious? Is there a reason for the current state of affairs? If it's a matter of Makefile/shell-script-fu, I can help out in that area. -- Gary R. Van Sickle List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest U