Jim doesn't "emphasize" the benefits of doing things this way because by
now we understand that this is "just how things are done."
If you relax checks like this in the grammar and place them in a
post-parse analysis (tree walker for example), some of your benefits
include:
* Faster parsing (som
though [...] I am rewriting all the grammars
>in v3 to be self hosted.
Didn't Sam Harwell already do that for the C# port?
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
List: http://www.ant
Hi Franklin,
You didn't say exactly what the bug was. That said, here's my feedback,
lots of it just my opinion not rules:
* Replace your call to {skip();} with {$channel = HIDDEN;}
* Replace ^(PHO[i, "pho"] $i) with just PHO[i, "pho"]. When you
construct the PHO token from i, it takes on the te
/downloads/antlr-dotnet-source-3.2.0.6288.7z
Thank you,
Sam Harwell
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to il-antlr-interest
Text File" with the extension .g or .g3, and set its build
action. You no longer have to manually add grammars by editing the
project file.
Finally, make sure you add a reference to the appropriate ANTLR runtime
(CSharp2 or CSharp3).
Thank you,
Sam Harwell
--~--~-~--~~
Hi Kyle,
You can find them (the C# ports of StringTemplate and the Antlr Tool,
along with the bootstrap binaries) under this folder:
http://fisheye2.atlassian.com/browse/antlrcs/
Sam
From: Kyle Ferrio [mailto:kfer...@gmail.com]
Sent: Saturday, October 24, 2009 4:21 PM
To: Sam Harwell
r
projects.
I'll be re-packaging everything as a regular download in the near
future.
Thank you,
Sam Harwell
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to
that out too, but it should be straightforward.
Sam
From: Jim Idle [mailto:j...@temporal-wave.com]
Sent: Tuesday, October 20, 2009 12:08 AM
To: Sam Harwell; antlr-inter...@antlr.org;
stringtemplate-inter...@antlr.org
Subject: RE: [antlr-interest] Status of the CSharp3 target and my C#
ource, but
most will want ot use the 'offical' java version of the tool even if
they are targeting C#.
Thanks for the updates,
Jim
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of Sam Harwell
Sent: Monday, October 19, 2009 1:05 AM
Hi everyone,
Here's a status update that I know many people are asking for. For each
portion, I'll talk about the status of the code in Perforce. At the end,
I'll talk about the status of the posted binaries.
Basic Status
StringTemplate and the ANTLR Tool: Up-to-date with the Java versi
directly.
-Original Message-
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of C. Mundi
Sent: Saturday, October 17, 2009 12:29 PM
To: antlr-inter...@antlr.org
Subject: Re: [antlr-interest] Which version do I need for a CSharp
targetand VS 2008
Sam
-
From: Gavin Lambert [mailto:an...@mirality.co.nz]
Sent: Thursday, October 08, 2009 2:23 PM
To: Sam Harwell; Jim Idle; antlr-inter...@antlr.org
Subject: Re: [antlr-interest] MSBUILD/Vs2008
At 12:20 8/10/2009, Sam Harwell wrote:
>* Create a working Clean target (which
>carries
The only complete working grammar for ANTLR v3 written in ANTLR v3 is
the set of grammars in my C# port, and they use the CSharp3 target. The
C# port of the ANTLR tool uses these grammars internally for all its
processing, so they are tested working. It would take a significant
amount of work to p
I disabled the clean due to problems with P4 having the generated files
readonly on disk. You can use it as a base for future improvements if
you want.
This forces the correct build order so you only have to build once (I
included the import line just so you see where I placed it). This
configu
Are you trying to run a generated parser, or are you actually trying to run
Antlr3.exe on the CF to generate your parser?
If you only want to run the generated parser, then you probably only need to
compile Antlr3.Runtime.dll (CSharp3 target) or Antlr.Runtime.dll
(CSharp/CSharp2 target).
Sam
In order of their effect, here are the things you'll want to do to
improve speed. And when I say these are ordered, I mean there's a good
chance that changing a lower bullet point without changing the ones
above will have negligible results.
* Left factor your grammar to remove the back
You'll need to reference both runtimes. I don't *think* there is a
namespace conflict but if there is, here's how you have to resolve it:
* Sign the assembly that references both ST 3.2 (my build) and the
CSharp runtime (Johannes' build). That's the only way to get it to
side-by-side load types t
My build does not exhibit this behavior (the generated files are only
generated if they are out of date). I highlighted a section in the
Target definition which clearly differs from the web page description
and I know is used when checking for out-of-date dependencies.
Here is a combined gramma
1. Derive a class CustomizedErrorNode from your class CustomizedNode.
2. Derive a class CustomizedTreeAdaptor from CommonTreeAdaptor. In it,
override create(Token) to return a CustomizedNode, and override
errorNode(TokenStream,Token,Token,RecognitionException) to return a
CustomizedErrorNode.
Se
Simply using a tree grammar won't alter the input tree. If you want
customizable actions, use something like this:
tokenSpec
: TOKEN_REF {TrackToken($TOKEN_REF);}
;
Then in your helper file (which you can create since the tree grammar
class is declared partial in cod
arget)
At 01:31 21/07/2009, Elnur Cabarov wrote:
>I use Antlr executable by Sam Harwell, but rule methods for
>CSharp3 target are private, so I can't call them externally
Have you tried putting "public" in front of the rules you want to
be callable? (This doesn't make any
@antlr.org] On Behalf Of Sam Harwell
Sent: Saturday, June 27, 2009 8:26 PM
To: Gavin Lambert; Elnur Cabarov; antlr-inter...@antlr.org
Subject: Re: [antlr-interest] Using ANTLR without Java
I don't have a packaged release available, but the source in my branch
is completely up-to-date with
re Java.
If you really are trying to let end-users compile grammars, and
want a native solution, then you'll probably have to wait a
while. IIRC Sam Harwell (the C# target maintainer) has done some
work towards porting the whole of ANTLR (including the compiler)
to C#. But it's still
FxCop freaks out on ANTLR generated code right now and slows down so much it's
effectively unusable. I've been meaning to address this issue in the CSharp3
target, but haven't yet. I'm curious how you're supposed to handle partial
classes with the GeneratedCode attribute - I assume I have to ma
[I read the rest of this thread as well.]
The backtrack=true option *destroys* the ability to provide useful error
messages. A backtrack+memoize grammar is *much* less efficient in both
time and space than a left-factored grammar written for ANTLR with these
in mind. The options are potentially u
I pondered the idea of an F# target a while back, but I quickly realized
I was in over my head. For academic reasons I'd be very interested in
the result if you do build an ocaml target. :)
Sam
-Original Message-
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr
ually lighter than a flyweight token,
but again it can only be used as long as you don't need more information
than it's able to store.
Sam
From: George Scott [mailto:george.sc...@gmail.com]
Sent: Friday, May 22, 2009 4:09 PM
To: Sam Harwell
Cc: antlr-inter...@antlr.org; antlr-...@ant
As I mentioned once in the past, I've been working on improving lexer
performance for applications where the full information/features in
Lexer/CommonToken is not required. A key example is syntax highlighters
which have strict performance requirements and must be updated as a
person types. I'll st
o:j...@temporal-wave.com]
Sent: Wednesday, May 20, 2009 2:47 PM
To: Terence Parr
Cc: Sam Harwell; antlr-inter...@antlr.org
Subject: Re: [antlr-interest] Unnecessary Java output file diffs
Terence Parr wrote:
> All you have to do is alter the line in Java.stg template file. We
> could add an
I wanted to make an option that doesn't include the timestamp and line
number in the generated file, but I couldn't think of a name for it.
Anyone have any suggestions?
Sam
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of Tom Ball
Sent: Wednesday
rule
: something
;
catch[ExceptionType e] { stuff... }
finally { more stuff... }
-Original Message-
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of Warren Falk
Sent: Thursday, May 14, 2009 5:11 PM
To: Terence Parr
Cc: antlr-in
I know at least the CSharp2 target supports generics there. :)
Sam
-Original Message-
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of Jim Idle
Sent: Friday, May 08, 2009 2:06 PM
Cc: ANTLR
Subject: Re: [antlr-interest] AST rewrite bug C# targe
You should always reference rule arguments and return values with a $,
as in $ids. I'm thinking about making a mode that mangles the names of
items that aren't meant to be accessed directly, which is required for
some optimization work I've been planning.
Sam
From: antlr-interest-boun...@an
eems like a good way to go.
I'll look into Android. I'm curious now. Its challenging for me to
understand how the folks at Google could make
a loser (big mistakes) like the one you refer to after having so many
winners.
W.
From: antlr-i
While this is somewhat true of Java, it's really not true of C#. The
built-in primitive types in both languages (int, short, double, char,
bool) are passed by value in function calls and kept on the stack as
local variables. The process of boxing in both languages takes a
primitive type and wraps i
Hi Martijn,
The state stack is unreliable in combination with semantic predicates and
"cannot" be used in that manner. Instead you should use a construct like . or
^(IF .*) to skip the subtree in your walker.
Sam
-Original Message-
From: antlr-interest-boun...@antlr.org
[mailto:antlr-
Hi Bill,
If the identifiers are uniquely determined by the lexer, you'll gain a
significant performance advantage by something like this:
for ( Token token = lexer.nextToken(); token != null; token =
lexer.nextToken() )
{
if ( token.getType() == Token.EOF )
break;
if ( token.getType() =
Hi Bill,
In the 'expr' rule, you have the following action that is missing a
semicolon:
{$value = $e.value}
In the 'atom' rule, you have an action with a call to toInt32 instead of
ToInt32.
You should add a cast to ArrayList in your action in the 'elist' rule.
I can't reproduce the 'eee' error
ntime. The bootstrap files are everything in this folder and its
subfolders:
http://fisheye2.atlassian.com/browse/antlrcs/bin/Bootstrap
Thank you,
Sam Harwell
-Original Message-
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of
cr...@palantir.
Actions surrounded in double angle brackets are "always" run. This means
they run during backtracking, but they may or may not run during
prediction. If you're not careful, they may have unpredictable results.
Here is what they look like:
rule : subrule {{AlwaysRunMe();}} ;
You also have th
I'm working with much larger input files (a few thousand normal source
code files).
The significant action performed on a TreeNodeStream is a call to
LA(int32). For BufferedTreeNodeStream, this encloses the call to
FillBuffer().
The profiler revealed that BufferedTreeNodeStream.LA used 3.10
Hi Bob,
You should make a filter lexer that parses the doc comments by
themselves. In your main lexer, read the entire token as a single
comment, then you can later pass the text of those comments to the
doxygen tag filter lexer to extract the information from those comments.
It works great and
t] Relaxed number format lexer problem
Sam Harwell wrote:
I'm using a heavily relaxed NUMBER token in my lexer so I can provide
better error messages. The problem I'm having occurs when input such as
1..2 is reached. The '..' should be an OP_RANGE token, not part of the
numb
7;a'..'d'
| 'f'..'z'
| 'A'..'D'
| 'F'..'Z'
)
| &
A few things to note:
The new unbuffered token stream class (in for version 3.2 I believe) throws a
NotSupportedException if you try to get its size.
ITokenStream implements IIntStream, and you can't implement IEnumerable
and IEnumerable on the same object with reliable results. I looked to th
t result in any problems, I'll just build a line buffer,
but don't want to buffer the whole file of course (my lexer will be
called externally, so I don't even have full access to the document).
Kind regards
Peter
Sam Harwell schrieb:
> You should tokenize on a per-line b
m definite
positionindocument?
Sam Harwell schrieb:
> Is this part of a syntax highlighter?
>
Yes.
> Either way, you can always take an arbitrary token from your original
> token stream that falls before the location in the document where a
> change occurred, and substring your docum
Is this part of a syntax highlighter?
Either way, you can always take an arbitrary token from your original
token stream that falls before the location in the document where a
change occurred, and substring your document text at that location. Then
create a token stream based on the original toke
or close delimiter
* Part three, beginning of final line through the closing delimiter of
the comment. */
Sam
From: Gerald Rosenberg [mailto:ger...@certiv.net]
Sent: Thursday, April 16, 2009 12:24 AM
To: Sam Harwell; antlr-inter...@antlr.org
Subject: RE: [antlr-interest] Building syntax highl
s.
Note, the attached version is set up for just for single char
delimiters.
At 10:56 AM 4/15/2009, Sam Harwell wrote:
The new method uses a very different override of NextToken(). The outer
loop is largely a duplication of the functionality of Lexer.NextToken().
I've highlighted the k
// match() routine has already called recover()
}
}
}
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of Sam Harwell
Sent: Thursday, April 09, 2009 3:38 AM
To: antlr-inter...@antlr.org
Subject: [antlr-interest] Building synta
I make my IntelliSense parser stop after N exceptions (default 20) via
an OperationCanceledException to prevent major performance problems with
very large files in the IDE, since the file is often syntactically
incorrect while it is being edited and it's reparsed often.
Sam
From: antlr-inte
The error handling mechanisms are fairly complicated, but adding your
own handlers is easy.
Just call the base versions after you do what you want:
public override void ReportError( RecognitionException e )
{
// do something, the StackTrace for e will tell you where the error
occurred
base.R
It's a good idea to override ReportError, and this will almost surely
provide you with the results you want. You can also put a breakpoint in
NoViableAltException's constructor.
Sam
-Original Message-
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Be
, April 13, 2009 7:55 AM
To: Sam Harwell
Cc: ANTLR Interest Mailing List
Subject: Re: [antlr-interest] Predicate hoisting pain
Sam Barnett-Cormack wrote:
> I guess the question really is, for me, why does it get hoisted in one
> case and not another? I'm assuming it's be
Hoisting is a very difficult problem. Until I finish my new spec for
implementing reliable hoisting, I suggest one of the following:
High speed solution A, used as appropriate:
elementsTrue
: objectSetElements
| LPAREN! elementSetSpecTrue RPAREN!
;
elementsFalse
: subtypeElements
Here's one way you can handle the keyword scoping problems straight from
the parser:
In your parser, you instead of referencing IDENTIFIER, create two rules
like this:
identifier : IDENTIFIER;
withSyntaxIdentifier : IDENTIFIER | KEYWORD1 | KEYWORD2 ;
And reference these two as appropriate from
$a.tree or $a.token are possibilities. :)
Sam
From: dhjdhj [mailto:dhj...@gmail.com]
Sent: Friday, April 10, 2009 2:24 PM
To: Sam Harwell
Cc: antlr-inter...@antlr.org
Subject: Re: [antlr-interest] How can I find the line number and column
for asemantic error
Capturing errors is not
AddError( message, token, Severity.Warning );
}
Sam Harwell
-Original Message-
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of dhjdhj
Sent: Friday, April 10, 2009 11:16 AM
To: antlr-inter...@antlr.org
Subject: [antlr-interest] How can I find
I've made a few posts about this in the past, and it looks like another
one is on the way. I designed a new, much easier, robust, and general
way to make a syntax highlighter from a grammar, and it even allows
clean "stacking" of lexers. As a quick example, my primary grammar
recognizes a block com
This is probably not perfect (haven't run it) but it should get you
close at the least. Based on the CSharp2 target.
@parser::members
{
CommonTree BuildProxyOptionTree(
SortedList> options )
{
object root = adaptor.Nil();
foreach ( KeyValuePa
There’s a big problem. You can parse this using a synpred, but it will have
O(n²) complexity in the length of your input. Is there another possible
terminator for the raw data? Newline maybe? With newline terminating the raw
data, you’d still have O(n²) complexity in the length of the line. You
Also, -Xconversiontimeout 0 disables the timer if that's the condition
you're testing.
Sam
-Original Message-
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of Terence Parr
Sent: Tuesday, March 31, 2009 1:05 PM
To: Ola Bini
Cc: antlr-inter...@a
...@deinprogramm.de]
Sent: Tuesday, March 31, 2009 11:58 AM
To: Sam Harwell
Cc: antlr-inter...@antlr.org
Subject: Re: [antlr-interest] Generic parser class
"Sam Harwell" writes:
> It doesn't currently support that. However, I've spent a fair bit of
> time looking into th
It doesn't currently support that. However, I've spent a fair bit of time
looking into the possibilities of it. Can you give an idea of specifically what
you're trying to accomplish with the generics, and if it falls into one of the
areas I've worked on I can give some ideas on how to progress.
Try changing all your usage of CommonTreeNodeStream to BufferedTreeNodeStream,
and see if it corrects the issue. Also, do you have any way to check if the
time increase was in the lexer, parser, or tree walker?
Sam
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@ant
If you don’t left-factor your rules, it attempts to do so for you. If that
process takes longer than the timeout period (default 1 second), it assumes it
can’t be done and errors out. Of the two rules below, the former is vastly
superior. If you absolutely must use something like the second, at
Change your postfixExpression to this:
postfixExpression
: leftHandSideExpression (('++'|'--') => ( '++' | '--' )?)
;
Sam
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of Filipe David Manana
Sent: Wednesday, March 25, 2009
Do you know which method is too long? I have a few ideas but it'd narrow
down my thinking about it if I knew that.
Sam
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of Miguel Marques
Sent: Wednesday, March 25, 2009 6:39 AM
To: antlr-inter...@antl
I use .g3 for all my V3 grammars, including all the ones in the C# port
of the Tool, so I already implemented support for multiple extensions.
You can use similar code to offer flexibility to the allowed extensions.
However, in the particular use in the Tool (filtering after graph
sorting), I bel
You need to switch to use the new BufferedTreeNodeStream class instead.
The new CommonTreeNodeStream is unbuffered, so it can't know the size.
Sam
-Original Message-
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of Shaoting Cai
Sent: Monday, M
: Dennis Brothers
Cc: ANTLR Interest Mailing List
Subject: Re: [antlr-interest] Documenting grammars
Dennis Brothers wrote:
> On Mar 23, 2009, at 2:23 PM, Sam Barnett-Cormack wrote:
>
>> Sam Harwell wrote:
>>> Why not create our own format that properly describes grammars?
>&g
Yes, you can. If you want to work with those tokens, just pass your
channel number to the CommonTokenStream constructor.
Sam
-Original Message-
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of Sam
Barnett-Cormack
Sent: Monday, March 23, 2009 1
linked to full-size versions.
Sam (Harwell)
-Original Message-
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of Sam
Barnett-Cormack
Sent: Monday, March 23, 2009 11:04 AM
To: Jim Idle
Cc: ANTLR Interest Mailing List
Subject: Re: [antlr-interest
I'm having trouble remembering the case where this came up in the
(distant?) past. I'm thinking the non-greedy wildcard might actually
resolve the issue.
-Original Message-
From: Terence Parr [mailto:pa...@cs.usfca.edu]
Sent: Saturday, March 21, 2009 2:26 PM
To: Sam Harwell
Currently you can only invert sets in a synpred. It seems like inverting
the entire predicate could be useful. It could be implemented by
backtracking returning state.failed instead of !state.failed, though
putting it in the dfa could be a bit tougher (but doable).
I'm particularly interested i
Just .* EOF
Would work too. :)
-Original Message-
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of Terence Parr
Sent: Saturday, March 21, 2009 2:18 PM
To: Sam Barnett-Cormack
Cc: ANTLR Interest Mailing List
Subject: Re: [antlr-interest] proposa
Absolutely (as in I like the idea, no objection). You can always add .*
(nothing) or .* EOF if you want to match to the end. Clearly someone who
writes .* (anything not EOF) is not trying to read to the end. :)
The following is not greedy/works great already:
ML_COMMENT
: '/*' .* '
Performance will suffer in a big way. Use a class like the following for
your input.
Sam
public class CaseInsensitiveString : ANTLRStringStream
{
// the string used for lookahead (performance improvement by not
having to call char.ToLowerInvariant())
string _lastring;
pub
You should compile the CSharp runtime in Visual Studio 2005 or 2008.
That's the one used by the CSharp2 target. The "target" refers to what
you put in the grammar's options section - if you use CSharp2 then the
generated code will make use of some C# 2.0 features, but extends the
same runtime clas
Once you get the hang of it, you can do it by hand without too much
trouble. For example, in converting a v2 grammar to v3, I encountered
this in the members section:
stringAlias =
#(#[BLOCK], #(#[ALT], #[STRING_LITERAL], #[EOA]), #[EOB]);
Which became this (you can use CommonTree
When at all possible, avoid using semantic predicates, as they will
greatly slow down your grammar relative to a properly left-factored
grammar. If the negated set works, it is probably your best option for
now. Maybe I can add a subtract set operation you can test, although I
couldn't check it in
Invoke the ANTLR Tool from the working directory containing your
grammar, and pass the filename without the path. The name and path that
show in the generated code are the same as what was passed on the
command line.
Sam
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@
You have a few options:
1. Only build an AST in the parser, then use a tree walker to
perform your needed operations. This is the "v3" way to do it,
especially with the new filter-mode tree parsers on the way.
2. Call virtual functions from your actions, and implement those
functio
You'll need to convert all actions and semantic predicates to valid python
code. These are present in [at least] the following rules:
assignmentOperator
relationalOp
shiftOp
ENUM
ASSERT
Sam
-Original Message-
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.
Visual Studio Shell 2008 is free for commercial use. That's what we use.
Sam
-Original Message-
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of Ralf Düsedau
Sent: Tuesday, February 17, 2009 8:49 AM
To: antlr-inter...@antlr.org
Subject: [antl
If you have the option output=AST specified, then your rewrite rules are the
default behavior. Unnecessary rewrites will incur a significant performance
penalty since they are not optimized. The penalty is masked if the grammar is
not properly left-factored, but it should still be avoided. The
Yep, this is exactly what I use ANTLR for. If you choose to use Visual Studio
as your framework IDE, then feel free to ask specific questions here or on the
Visual Studio Extensibility (VSX) forum. If you ask ANTLR-related questions
over at VSX, you can drop me an email separately to let me know
This works because lexer tokens are greedy:
LINE_COMMENT
: '//' (~('\n'|'\r'))* '\r'? '\n'?
{ $channel=HIDDEN; }
;
Sam
From: antlr-interest-boun...@antlr.org
[mailto:antlr-interest-boun...@antlr.org] On Behalf Of Brent Yates
Sent: Wednesday, Febr
/listinfo/antlr-interest
> Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>
Currently there is no way to do so. At least with the Java version of
the tool. Sam Harwell is working a C# port with some extended features,
which allows at least to use access modif
Hi Andreas,
Make the actions in your tree grammar call virtual/abstract functions. Then
derive a new all-code class from the tree grammar class that overrides those
functions to provide the action implementation. The ANTLR Tool itself uses this
pattern in the AssignTokenTypesWalker tree gram
You'll also see to call setTreeAdaptor (java target) in the @init section of
the entry rule(s) to your grammar. Your implementation of TreeAdaptor should
include implementations of at least the following 2 functions (example here is
the C# target just because I had it ):
class GrammarASTAdapto
tinue working. Two examples
are the continued move from get/set functions to properties, and making
function names start with a capital letter. I'll try and get a new set
of binaries and an updated version of nFringe's ANTLR language module
posted next week. I've made a few tweaks t
PS: Sorry about the duplicated mail. When I cc'd the author it bounced,
so I have to send it here again for him to see it.
Are you trying to write a grammar that is build by/targets ANTLR v2
runtime, or are you trying to write a grammar that can parse ANTLR v2
grammar files themselves?
I ha
Are you trying to write a grammar that is build by/targets ANTLR v2
runtime, or are you trying to write a grammar that can parse ANTLR v2
grammar files themselves?
I haven't worked with ANTLR v2, but I believe the information you are
looking for could be here:
http://www.antlr2.org/
Sam
(I'm only offering an independent opinion on this - definitely not
trying to insult anyone.)
This option feels "gimmicky" to me. It doesn't address the asynchronous
nature of core/target updates, target-to-target incompatibilities, and
doesn't identify breaking changes in the Tool between version
I have many posts on my blog about this subject. Here's the link to my blog,
and a link to the first major post specific to using ANTLR in an IDE. The
ANTLR-based highlighters we're using are nowhere near as slow as Eclipse.
However, there are many places where IDE performance imposed "interest
ASTLabelType only changes what nodes are cast to inside the generated code. For
example, if you call a function from an action in your grammar, and pass it a
node, it will pass a Tree interface (ITree in the CSharp/CSharp2 runtime) by
default:
MyFunction( ((Tree)someNode) );
However, if you s
All Visual Studio language service features run on separate threads from the
main UI thread. I have several posts on my blog (http://blog.280z28.org/)
talking about ANTLR/Visual Studio integration for language services. If you are
interested, I could probably add articles on the following:
·
I've mentioned this behavior several times before. Currently, despite
the error, the Tool does behave in the way it states (it references the
enclosing rule). I assure you there is no syntactic or semantic
ambiguity in this use case under the documented rules of an ANTLR
grammar's rewrite syntax.
1 - 100 of 171 matches
Mail list logo