ANTLR is overkill for binary file formats: I know of no binary file format
that requires more than one (variable length) item of lookahead for processing,
nor would I expect to find one--binary formats are intentionally designed and
evolved.
It is fairly simple to design a language for
UP and DOWN tokens (start/end of child list for tree) do not have location
information attached so no line/column error reporting. Mostly the error says
that you started a subtree that your grammar does not match, probably an LPAREN
or RPAREN rooted subtree from your report of cases where you
And then you have to figure out how to prune the GLR-generated forests. C++
is nasty; it can be parsed with ANTLR (as shown by NEXT and David Wigg's
adaptions of that grammar), but I believe that the right strategy with ANTLR is
actually to use multi-pass recognition to sort out the
On 3.) : The parser just recognizes syntax and ignores semantic ambiguities;
then in a first tree walker pass, the symbol tables are constructed; a second
tree walker pass uses the symbol table information to resolve ambiguities
(which
of several interpretations of valid syntax is correct)
with language translation, and a bit of book learning would not be out of
order.
--Loring
From: Douglas Godfrey douglasgodf...@gmail.com
To: Loring Craymer lgcray...@yahoo.com
Cc: The Researcher researcher0...@gmail.com; antlr-interest@antlr.org
Sent: Monday, July 11
Optimal placement of parentheses is tricky; as a first step, you want to use
the
form
^('+' A B C D E F )
as long as the operator is associative;
then you want to parenthesize only when required to by changes in operator
precedence; the easiest way is actually to have two versions of each
Sam--
Are you working on the SemanticContext classes for this? That seems to be
where
the problem originates--no effort is made to refactor generated trees.
--Loring
- Original Message
From: Sam Harwell sharw...@pixelminegames.com
To: Terence Parr pa...@cs.usfca.edu;
You probably want to check out http://fortran-parser.sourceforge.net/.
--Loring
- Original Message
From: piet...@agh.edu.pl piet...@agh.edu.pl
To: antlr-interest@antlr.org
Sent: Thu, March 31, 2011 12:24:19 AM
Subject: [antlr-interest] Fwd: F77 grammar
Hi,
I have problem
The likely cause of your problems is the extensive use of fragment rules.
ANTLR
3 does not use follow sets in lexers and invocation of fragment rules usually
disables LL* processing. Inline your fragment rules, and your current problems
should disappear, although others may still lurk.
the issue.
This is strange to me as it was not used in the rule litteralRange.
Does anyone know how is this possible ?
Thanks for your help
Fabien.
Le 29/03/11 19:53, Loring Craymer a écrit :
The likely cause of your problems is the extensive use of fragment rules.
ANTLR
3 does
Vocabulary import uses StreamTokenizer in Grammar.importTokenVocabulary(String
vocabName). There is a minor bug in that error recovery consumes tokens until
TT_EOL is found; that should be either TT_EOL or TT_EOF. You might try fixing
that and reporting if the fix works.
--Loring
-
This is the sort of problem that can be solved with lexer modes. ANTLR 3 does
not support lexer modes, however, so the usual approach is two phase parsing,
where the first pass would parse text outside of [ ] but recognizes [ ... ]
constructs as single tokens. The second pass processes the
This involves algebraic rewrites; you want to extend an algebraic normal form
(see wikipedia article) to include exponentiation and express division in terms
of negative exponents and compare formulae after conversion to normal form.
And
you probably want to do constant folding (another
You can, of course, do
COMMENT : '\n' 'C' (~'\n')+ ;
NEWLINE: '\n' ;
(the ordering matters for ANTLR 3's DFA construction), but the approach Brodie
suggested is the common idiom since it costs less in terms of performance and
does not depend on the quirks of ANTLR DFA construction. Start of
...@antlr.org;antlr-interest-boun...@antlr.org
[mailto:antlr-interest-
href=mailto:boun...@antlr.org;boun...@antlr.org] On Behalf Of Loring
Craymer
Sent: Saturday, May 29, 2010 3:26 PM
Don't walk the tree to evaluate the expression; walk
the tree to
generate byte code
- Original Message
From: Jane Eisenstein ja...@softweave.com
To: Loring Craymer lgcray...@yahoo.com
Cc: Jim Idle j...@temporal-wave.com; antlr-interest@antlr.org
antlr-interest@antlr.org
Sent: Sun, May 30, 2010 5:08:12 PM
Subject: Re: [antlr-interest] short circuiting further evaluation
Don't walk the tree to evaluate the expression; walk the tree to generate byte
code and then interpret the byte code. The overall problem then gets simpler
and the resulting code runs faster.
--Loring
- Original Message
From: Jane Eisenstein ja...@softweave.com
To: Farr, John
Tree grammars describe AST processors, and are more powerful than visitors
since they recognize token sequences as productions. See
http://www.antlr.org/article/1100569809276/use.tree.grammars.tml.
--Loring
- Original Message
From: Tyler Distad tyler.dis...@gmail.com
To:
ECL is commercially friendly, and shows lots of work by the IBM lawyers to
build a license for a flagship open source project done for commercial reasons.
IBM's Websphere development platform is the commercial version of eclipse.
--Loring
- Original Message
From: Terence Parr
the target developers have to follow the Java changes. I don't use
ANTLRWorks, so I can't say much more than this.
--Loring
From: Gokulakannan Somasundaram gokul...@gmail.com
To: Loring Craymer lgcray...@yahoo.com
Sent: Mon, February 15, 2010 11:15:44 PM
Subject: Re: [antlr-interest] setting k Value
Well, it is possible that there is an analysis bug, but it is more likely that
the rule you deleted invoked other rules in a fashion that caused the
ambiguity. There is no such thing as a non reachable rule: any rule could
be an entry rule (that is, one invoked from target language code, not
Oliver--
Some key points:
1.) Capture semantics rather than designing tree structures.
2.) Preserve grammar structure--that is, rule a in pass n becomes rule a in
pass n+1 unless there is reason to do otherwise.
3.) Avoid cluttering your grammars with action code.
4.) Separate analysis
22 matches
Mail list logo