[il-antlr-interest: 34943] Re: [antlr-interest] C# problem with the gettext()

2011-11-17 Thread Sam Harwell
The C# code uses C# conventions in many (hopefully most) places. input.LT(1).Text Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of karen Sent: Thursday, November 17, 2011 6:25 AM To: antlr-interest@antlr.org Subject:

[il-antlr-interest: 34791] Re: [antlr-interest] .g vs .g4

2011-11-07 Thread Sam Harwell
that identifies the version, I think we were going to use the file extension for this reason. all v3 grammars will be .g and people building v4 grammar should name them .g4 Ter On Nov 6, 2011, at 9:29 AM, Eric wrote: On Sun, Nov 6, 2011 at 12:22 PM, Terence Parr pa...@cs.usfca.edu wrote: Hi, Sam

[il-antlr-interest: 34717] Re: [antlr-interest] delimiters directive does not work with C# version of StringTemplate

2011-11-04 Thread Sam Harwell
Hi Maik, Currently the delimiters syntax only works with group files (TemplateGroupFile, *.stg), not standalone template files (TemplateGroupDirectory, *.st). Based on the error message you listed, I'm guessing this is the problem? Sam -Original Message- From:

[il-antlr-interest: 34741] Re: [antlr-interest] StringTemplate and Antrl3.runtime version mess on C# target

2011-11-04 Thread Sam Harwell
[mailto:andy.voel...@plantronics.com] Sent: Friday, November 04, 2011 1:51 PM To: antlr-interest@antlr.org Cc: Eric; Sam Harwell (sharw...@pixelminegames.com) Subject: StringTemplate and Antrl3.runtime version mess on C# target I've done some further investigation on this problem, and it seems

[il-antlr-interest: 34743] Re: [antlr-interest] StringTemplate and Antrl3.runtime version mess on C# target

2011-11-04 Thread Sam Harwell
I went ahead and edited the description of the Bootstrap release. Can you check it and let me know if it makes things more clear? Thanks, Sam From: Voelkel, Andy [mailto:andy.voel...@plantronics.com] Sent: Friday, November 04, 2011 3:01 PM To: Sam Harwell; antlr-interest@antlr.org Cc

[il-antlr-interest: 34666] Re: [antlr-interest] working examples for StringTemplate4 and C#? (I'm stuck again)

2011-10-30 Thread Sam Harwell
Do you have a stack trace or any other information about where the exception occurs? In Visual Studio, you can get a stack trace even if you don't have the source code by going to DebugExceptions..., checking the box next to UriFormatException, and then looking at the Call Stack window after the

[il-antlr-interest: 34635] Re: [antlr-interest] Are token aliases possible?

2011-10-28 Thread Sam Harwell
In the Java version, the rewrite syntax is the definitive way to specify the type of a tree node. In the newer versions of the C# port, you can specify tree node types as a token option, so you could do this and be equivalent to your rewrite rule. Note that I added a ^ as well; your first example

[il-antlr-interest: 34649] Re: [antlr-interest] tool version mismatch for C# target??

2011-10-28 Thread Sam Harwell
Hi Andy, I just checked the Wiki and the downloads, and see the inconsistency. ANTLR.exe uses StringTemplate for code generation, but now only depends on ST4. I ended up removing ST3 from the Bootstrap download as a result. You can download ST3 as a separate download from the wiki:

[il-antlr-interest: 34652] Re: [antlr-interest] tool version mismatch for C# target??

2011-10-28 Thread Sam Harwell
No, as far as I know Antlr 3 will always produce code for ST3. ANTLR 4 will produce code for ST4 by default. Sam -Original Message- From: Voelkel, Andy [mailto:andy.voel...@plantronics.com] Sent: Friday, October 28, 2011 1:11 PM To: Sam Harwell; 'ANTLR interest' Subject: RE: [antlr

[il-antlr-interest: 34654] Re: [antlr-interest] tool version mismatch for C# target??

2011-10-28 Thread Sam Harwell
-Original Message- From: Voelkel, Andy [mailto:andy.voel...@plantronics.com] Sent: Friday, October 28, 2011 2:11 PM To: Sam Harwell; 'ANTLR interest' Subject: RE: [antlr-interest] tool version mismatch for C# target?? I didn't know there was an ANTLR 4. The website advertises 3.4

[il-antlr-interest: 34584] Re: [antlr-interest] Exceptions on C#-Target

2011-10-25 Thread Sam Harwell
Hello, I just ran your test, and it didn't throw any externally visible exceptions. Internally I would expect a very large number of exceptions because your lexer has no rules that match any of your input except comments, whitespace, the word CREATE, and the semicolon at the end. Sam

[il-antlr-interest: 34504] Re: [antlr-interest] More problems with ANTRL C#3 target and tools

2011-10-21 Thread Sam Harwell
, October 21, 2011 2:10 PM To: antlr-interest@antlr.org Cc: Sam Harwell (sharw...@pixelminegames.com) Subject: More problems with ANTRL C#3 target and tools Hi, I got over a first round of problems and got a few trivial example working. I then moved on to trying to convert on of the examples from

[il-antlr-interest: 34456] Re: [antlr-interest] How viable is the Csharp3 target?

2011-10-19 Thread Sam Harwell
Hi Andy Maik, I agree that the C# target documentation is lacking in many ways. I try to keep enough documentation at the following page to get you started on the right path: http://www.antlr.org/wiki/display/ANTLR3/Antlr3CSharpReleases I've been using the CSharp3 target in a commercial product

[il-antlr-interest: 34227] Re: [antlr-interest] Re : incremental

2011-09-30 Thread Sam Harwell
Hi J. Rampon, I have an application in which individual files frequently change, and reparsing the entire set of 4000 files would take a significant amount of time. I handle this situation by keeping the parsed information in a loosely bound cache, so my incremental updates are simply reparsing a

[il-antlr-interest: 34205] Re: [antlr-interest] Csharp target, Recover(input, e)

2011-09-28 Thread Sam Harwell
I've never seen this occur before. Can you send me a project with a grammar and input that exhibits this? Thanks, Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Mari Matinlassi Sent: Wednesday, September 28, 2011

[il-antlr-interest: 34052] Re: [antlr-interest] Need quick ANTLR/ST3 hack

2011-09-14 Thread Sam Harwell
I believe if(rest(args)) will evaluate to true if args has more than one item. Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Bill Andersen Sent: Wednesday, September 14, 2011 1:26 PM To: antlr-interest Subject:

[il-antlr-interest: 34006] Re: [antlr-interest] ANTLRWorks 2 (for ANTLR v4)

2011-09-12 Thread Sam Harwell
This is easy for a parser. Just add the following to your grammar. @rulecatch{} Aside from answering the single question In the input recognized by this grammar? (yes/no), this is a rather useless thing to do. There are many, many other ways to approach error handling that are more appropriate

[il-antlr-interest: 34008] Re: [antlr-interest] ANTLRWorks 2 (for ANTLR v4)

2011-09-12 Thread Sam Harwell
12, 2011 10:40 AM To: Sam Harwell Subject: Re: [antlr-interest] ANTLRWorks 2 (for ANTLR v4) Hi. I think the @rulecatch has to be specified per rule, which makes it at least cumbersome for pretty much all grammars. Please correct me if I am wrong. How about the lexer? Do you mean failing

[il-antlr-interest: 33960] Re: [antlr-interest] ANTLRWorks 2 (for ANTLR v4)

2011-09-08 Thread Sam Harwell
With a carefully designed algorithm, autocomplete actually works quite well in an ANTLR grammar. I went over portions of the algorithm with Ter in the past, but it's outside the scope of what he's working on for ANTLR 4. A partial implementation will be included in the next release of my Visual

[il-antlr-interest: 33964] Re: [antlr-interest] For getCharPositionInLine(), is there a way to make tab count for 8 chars instead of 1?

2011-09-08 Thread Sam Harwell
I actually asked Dr. Parr recently about why the property is called CharPositionInLine instead of just Column. The name was actually picked to make it clear that tab and space are each treated as 1 character. When talking about parsing, the term Column also always refers to the character position

[il-antlr-interest: 33936] Re: [antlr-interest] Problems with Visual Studio 2010 and C#

2011-09-07 Thread Sam Harwell
Hi Amelie, You can find the latest version of the C# targets along with instructions for setting up your project in Visual Studio at the following location: http://www.antlr.org/wiki/display/ANTLR3/Antlr3CSharpReleases Thanks, Sam -Original Message- From:

[il-antlr-interest: 33899] Re: [antlr-interest] Using Tree Interface not plain Object

2011-09-04 Thread Sam Harwell
to create them and navigate them and manipulate them. Users can set up ASTLabelType as an option so that $x in actions has the user's type instead of plain object. Sam Harwell and I were talking today about restructuring all of the tree interfaces. We're breaking it up into a hierarchy with Tree

[il-antlr-interest: 33763] Re: [antlr-interest] How to use StringTemplate 4 with C#

2011-08-25 Thread Sam Harwell
In ANTLR 3, the output=template option is only able to produce code for ST3. You'll have to remove that option and write all your own actions if you want to target ST4. Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of

[il-antlr-interest: 33606] Re: [antlr-interest] CSharp3 code generation suggestions

2011-08-12 Thread Sam Harwell
license used for the runtime. Sam From: Ranco Marcus [mailto:ranco.mar...@epirion.nl] Sent: Friday, August 12, 2011 3:59 AM To: antlr-interest@antlr.org Cc: Sam Harwell ‎[sharw...@pixelminegames.com]‎ Subject: CSharp3 code generation suggestions Hi Sam, I have a few rather small

[il-antlr-interest: 33587] Re: [antlr-interest] Using ANTLR in Visual C# 2010 Express?

2011-08-11 Thread Sam Harwell
The Visual Studio Express Editions do not support any extensions other than simple code templates. You *should* be able to use the ANTLR extension with the free Visual Studio 2010 Shell (Integrated Mode), but I haven't tried this. Here are links to the installer and the SP1 update. Visual Studio

[il-antlr-interest: 33599] Re: [antlr-interest] ANTLR build process performance improvement

2011-08-11 Thread Sam Harwell
be. Sam From: chris king [mailto:kingce...@gmail.com] Sent: Thursday, August 11, 2011 2:59 PM To: Sam Harwell; antlr-interest@antlr.org Subject: Re: ANTLR build process performance improvement Hey Sam, thanks! I'm using it now and it's faster. Love the VS tool-chain! I'd be dead

[il-antlr-interest: 33575] Re: [antlr-interest] Access to line numbers

2011-08-10 Thread Sam Harwell
Both the Tree and Token interfaces have a method getLine(). Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of David Smith Sent: Wednesday, August 10, 2011 9:02 AM To: antlr-interest@antlr.org Subject: [antlr-interest]

[il-antlr-interest: 33579] Re: [antlr-interest] To Sam Harwell

2011-08-10 Thread Sam Harwell
...@gmail.com] Sent: Tuesday, August 09, 2011 11:47 PM To: Sam Harwell Cc: antlr-interest@antlr.org Subject: Re: [antlr-interest] To Sam Harwell Oops. Let's try this again... On Tue, Aug 9, 2011 at 9:41 PM, Sam Harwell sharw...@pixelminegames.com wrote: Hi Chris, You attached CSharp.cs instead

[il-antlr-interest: 33557] Re: [antlr-interest] To Sam Harwell

2011-08-09 Thread Sam Harwell
: Tuesday, August 09, 2011 6:29 PM To: Sam Harwell; antlr-interest@antlr.org Subject: Re: [antlr-interest] To Sam Harwell Sam, hey, so I might have bumped into a code gen bug. I'm trying to access a variable skipSection on the parent production of pp_conditional. It looks like the generated code

[il-antlr-interest: 33559] Re: [antlr-interest] To Sam Harwell

2011-08-09 Thread Sam Harwell
. :) Thanks, Sam From: chris king [mailto:kingce...@gmail.com] Sent: Tuesday, August 09, 2011 9:56 PM To: Sam Harwell; antlr-interest@antlr.org Subject: Re: [antlr-interest] To Sam Harwell Sam, hey. Sorry to shower you with e-mails today. :) I got your new version setup up and building but now

[il-antlr-interest: 33513] [antlr-interest] Optimizations for CSharp3 target with large grammars and output=AST

2011-08-06 Thread Sam Harwell
Hello everyone, I'm working on codegen optimization for grammars with output=AST. Medium to large grammars should see a significant improvement in the way local variables are handled in rules, *especially* when rewrite operators are used. Since this is currently an experimental

[il-antlr-interest: 33483] Re: [antlr-interest] Have I found an Antlr CSharp3 lexer bug if...

2011-08-04 Thread Sam Harwell
, tokens[0].Type); Assert.AreEqual(inputText, tokens[0].Text); Assert.AreEqual(PreprocessorLexer.EOF, tokens[1].Type); } Sam From: chris king [mailto:kingce...@gmail.com] Sent: Thursday, August 04, 2011 3:48 AM To: Sam Harwell; antlr-interest@antlr.org Subject: Re: Have I found

[il-antlr-interest: 33497] Re: [antlr-interest] To Sam Harwell

2011-08-04 Thread Sam Harwell
...@antlr.org] On Behalf Of chris king Sent: Monday, July 25, 2011 6:39 PM To: antlr-interest@antlr.org Subject: [antlr-interest] To Sam Harwell Sam, hey, hope this finds you. Very small suggestion follows :). In Antlr3.StringTemplate.csproj could you use AntlrBuildTaskPath$(MSBuildProjectDirectory)\..\bin

[il-antlr-interest: 33439] [antlr-interest] C# updates for ANTLR 3.4, StringTemplate 4.0.4

2011-07-30 Thread Sam Harwell
/Antlr3CSharpReleases Also, if you end up using (and liking) my Visual Studio 2010 extensions, I appreciate the reviews on the Visual Studio Gallery. :) Thank you, Sam Harwell List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest

[il-antlr-interest: 33429] Re: [antlr-interest] Fwd: Any HTML editors for rich editing of documents conforming to an ANTLR grammar?

2011-07-29 Thread Sam Harwell
grammar? To: Sam Harwell sharw...@pixelminegames.com Hi Sam, Thanks for the info. I had seen both of those, but they are too heavyweight for my needs - the editor must be a HTML5 construct. Shipping any desktop tool is a no-no as this is a web-application. Regarding You probably shouldn't try

[il-antlr-interest: 33399] Re: [antlr-interest] Have I found an Antlr CSharp3 lexer bug if...

2011-07-28 Thread Sam Harwell
[mailto:kingce...@gmail.com] Sent: Thursday, July 28, 2011 4:19 PM To: antlr-interest@antlr.org; Sam Harwell Subject: Have I found an Antlr CSharp3 lexer bug if... Have I found an Antlr lexer CSharp3 bug if I can alter program execution (exception instead of no exception) by introducing a lexer

[il-antlr-interest: 33404] Re: [antlr-interest] Interest in a Go lang port

2011-07-28 Thread Sam Harwell
Hi Parsiad, I believe he's referring to creating a new ANTLR target/runtime for Go (option language=Go), as opposed to using ANTLR to compile Go files into executable code. Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf

[il-antlr-interest: 33407] Re: [antlr-interest] Have I found an Antlr CSharp3 lexer bug if...

2011-07-28 Thread Sam Harwell
To: Sam Harwell Cc: antlr-interest@antlr.org Subject: Re: Have I found an Antlr CSharp3 lexer bug if... Sam, thanks so much for taking the time to look at that. If I could, let me try and explain what I'm trying to do and tell me if you think it's possible. For my own edification, I'm trying

[il-antlr-interest: 33368] Re: [antlr-interest] Quoted String Literal - confused by greed=false behavior.

2011-07-27 Thread Sam Harwell
You're reading the greedy option in reverse. :) I'd write the rule this way: STRING_LITERAL : '' ( options{greedy=true;} : '' | ~'' )* '' ; Sam -Original Message- From:

[il-antlr-interest: 33374] Re: [antlr-interest] Quoted String Literal - confused by greed=false behavior.

2011-07-27 Thread Sam Harwell
You have the following rule in your lexer. Remove it: DQUOTE : ''; Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of G. Richard Bellamy Sent: Wednesday, July 27, 2011 3:20 PM Cc: antlr-interest@antlr.org Subject: Re:

[il-antlr-interest: 33379] Re: [antlr-interest] Empty Quoted String Literal

2011-07-27 Thread Sam Harwell
Hi Richard, The double quote escape character in a verbatim string is , so what you're actually passing to the parser is a single (unmatched) quote. To pass an empty string, you'll need to use @. Sam -Original Message- From: antlr-interest-boun...@antlr.org

[il-antlr-interest: 33334] Re: [antlr-interest] To Sam Harwell

2011-07-25 Thread Sam Harwell
for bringing this to my attention. Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of chris king Sent: Monday, July 25, 2011 6:39 PM To: antlr-interest@antlr.org Subject: [antlr-interest] To Sam Harwell Sam, hey, hope

[il-antlr-interest: 33279] Re: [antlr-interest] Left recursive grammar

2011-07-21 Thread Sam Harwell
Your example is ambiguous as well as left recursive. I assume you meant one of the following: a : a B | A; a : A* B | A; The first can be written as: a : A (B^)*; The second can be written as a : A (A* B^)? | A | B; Sam -Original Message- From: antlr-interest-boun...@antlr.org

[il-antlr-interest: 33284] Re: [antlr-interest] ANTLR gives segmentation fault for very large input

2011-07-21 Thread Sam Harwell
To skip the AST, just don't use the output=AST option. Here are some specs on the tokens. I'm including the overhead of having them in a CommonTokenStream (or equivalent) because they're not very useful otherwise. Java target, 32-bit VM: 48 bytes/token. Java target, 64-bit VM: 64 bytes/token.

[il-antlr-interest: 33218] Re: [antlr-interest] CSharp3 target with 3.3.3 and extended AST Operators (or not).

2011-07-18 Thread Sam Harwell
Were you generating code with the C# port of the tool (Antlr3.exe) or with the Java version? I've only tested this feature with the C# version. I believe if you use the Java version to generate it, you have to explicitly state the terminal option. The C# port defaults to this option, but the Java

[il-antlr-interest: 33202] Re: [antlr-interest] Hi! about making a target for ANTLR

2011-07-16 Thread Sam Harwell
That's what it does now...? Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Douglas Godfrey Sent: Saturday, July 16, 2011 10:13 AM To: Terence Parr Cc: antlr-interest@antlr.org Subject: Re: [antlr-interest] Hi! about

[il-antlr-interest: 33151] Re: [antlr-interest] Tree pattern won't rewrite AST C#

2011-07-13 Thread Sam Harwell
In your partial class file that accompanies your grammar, you should add the following function override: partial class MyTreeParser { public override IAstRuleReturnScope Bottomup() { return bottomup(); } } Sam -Original Message- From: antlr-interest-boun...@antlr.org

[il-antlr-interest: 33142] Re: [antlr-interest] desperate noob

2011-07-12 Thread Sam Harwell
Also, make sure you back up a copy of the generated file you have. You don't want to accidentally generate some code over the top of it only to find out the new grammar wasn't yet complete. :) -Original Message- From: antlr-interest-boun...@antlr.org

[il-antlr-interest: 33100] Re: [antlr-interest] ASTLabelType C# Problem

2011-07-11 Thread Sam Harwell
You should throw a NotImplementedException instead of returning null. The rewrite exception indicates a mismatch between the matching and rewrite portions of the rules in your grammar. Typically that particular message appears when you have a rule written like one of the following: Example 1:

[il-antlr-interest: 33094] Re: [antlr-interest] ASTLabelType C# Problem

2011-07-10 Thread Sam Harwell
I'm not sure which templates are in use by AntlrWorks 1.4.2, but they certainly aren't the latest/correct version for the CSharp3 target. Under most conditions, the CSharp3 target doesn't emit the *_return classes at all, and renaming the rules wouldn't affect that. I suggest trying the latest

[il-antlr-interest: 33096] Re: [antlr-interest] ASTLabelType C# Problem

2011-07-10 Thread Sam Harwell
If your parser uses a special tree type, you should implement the following method in your helper file to ensure that there's never a case where the user forgets to set the tree adaptor. partial void CreateTreeAdaptor(ref ITreeAdaptor adaptor) { adaptor = new

[il-antlr-interest: 33086] [antlr-interest] Updated Visual Studio 2010 Extensions for ANTLR and ST4

2011-07-08 Thread Sam Harwell
-8052-113077 5473f8 Go Language Support (http://golang.org) http://visualstudiogallery.msdn.microsoft.com/bd7675ba-1bf5-4395-8c5a-4fc19d fc0d76 Thank you, Sam Harwell List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr

[il-antlr-interest: 32946] Re: [antlr-interest] ANTLR problem with .+ in tree grammar

2011-06-25 Thread Sam Harwell
I use the following rule for that: genericBlock : '{' (genericBlock | ~('{'|'}'))* '}' ; Since the curly braces are inside the genericBlock rule, you'll have to modify your componentStatement rule: componentStatement :'component'^

[il-antlr-interest: 32737] Re: [antlr-interest] [antlr-dev] Need help with tree traversing in ANTLR 3.3!

2011-06-10 Thread Sam Harwell
Hi Payam, Any rule in a parser or tree parser can return 0 or more items. Since the Java method implementing a rule can only return 0 or 1 items, some special handling is in place to allow you to do what you're after. Consider a rule foo which currently returns a single int: foo returns [int x]

[il-antlr-interest: 32709] Re: [antlr-interest] [CSharp3] rule visibility in composite grammars

2011-06-08 Thread Sam Harwell
target could create a partial method, and a C/C++ targets could declare the method in a generated header. Sam From: Douglas Godfrey [mailto:douglasgodf...@gmail.com] Sent: Tuesday, June 07, 2011 8:09 AM To: Ranco Marcus Cc: Sam Harwell; antlr-interest@antlr.org Subject: Re: [antlr-interest

[il-antlr-interest: 32603] Re: [antlr-interest] [CSharp3] rule visibility in composite grammars

2011-05-29 Thread Sam Harwell
classes C and D, then everything behaves like it was written in a single grammar. Do you see any immediate problems with this potential approach? -Original Message- From: Ranco Marcus [mailto:ranco.mar...@epirion.nl] Sent: Wednesday, May 25, 2011 4:26 PM To: Sam Harwell; antlr-interest

[il-antlr-interest: 32490] Re: [antlr-interest] ANTLR C# port

2011-05-19 Thread Sam Harwell
My initial guess is the exceptions are being thrown in the lexer. By default, the implementation of NextToken in the lexer catches any RecognitionException and handles it by skipping the invalid token. Custom handling of the exception depends on exactly what you're trying to accomplish. One way to

[il-antlr-interest: 32497] Re: [antlr-interest] ANTLR C# port

2011-05-19 Thread Sam Harwell
[mailto:misc.us...@gmail.com] Sent: Friday, May 20, 2011 3:58 AM To: Sam Harwell Cc: antlr-interest@antlr.org Subject: Re: [antlr-interest] ANTLR C# port I may have miscommunicated something here. I have a very simple Hello World! style grammar that I wrote to learn ANTLR. I deliberately fed the lexer

[il-antlr-interest: 32442] Re: [antlr-interest] meaning of #xxx

2011-05-12 Thread Sam Harwell
I think it translates to the following in ANTLR 3: sql_literal : (NUMBER | QUOTED_STRING | 'null') - ^(SQL_LITERAL[sql_literal] NUMBER? QUOTED_STRING? 'null'?) ; Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of

[il-antlr-interest: 32277] Re: [antlr-interest] [C#] Lexer Not Throwing Errors

2011-04-21 Thread Sam Harwell
Harwell Cc: antlr-interest@antlr.org Subject: Re: [antlr-interest] [C#] Lexer Not Throwing Errors On Thu, Apr 21, 2011 at 1:06 PM, Sam Harwell sharw...@pixelminegames.com wrote: Hi Justin, The exception does get thrown, but is handled in Lexer.NextToken() by tossing out a character and continuing

[il-antlr-interest: 32168] Re: [antlr-interest] throwing non-antlr exceptions

2011-04-12 Thread Sam Harwell
Hi Joe, This feature is not yet implemented in v3. I may be able to get it implemented for release 3.4, but there are some technical issues that prevent it from working in a few cases that make it difficult. Sam -Original Message- From: antlr-interest-boun...@antlr.org

[il-antlr-interest: 32127] Re: [antlr-interest] [CSharp3] rule visibility in composite grammars

2011-04-07 Thread Sam Harwell
- From: Ranco Marcus [mailto:ranco.mar...@epirion.nl] Sent: Thursday, April 07, 2011 6:49 AM To: Sam Harwell; antlr-interest@antlr.org Subject: RE: [antlr-interest] [CSharp3] rule visibility in composite grammars Sounds great, Sam! What will be the visibility of the methods in the 'Delegated

[il-antlr-interest: 32107] Re: [antlr-interest] Q: how to incorporate a preprocessor in the flow?

2011-04-06 Thread Sam Harwell
was architected (it's how I would have done it in hardware though!). Martin On 11-04-04 09:25 AM, Sam Harwell wrote: I used a hand-crafted implementation of TokenSource between the lexer and parser. In the preprocessor, whenever I manipulated a token I used a new token class derived from

[il-antlr-interest: 32109] Re: [antlr-interest] [CSharp3] rule visibility in composite grammars

2011-04-06 Thread Sam Harwell
Hi Ranco, I made the following changes so far: * An imported grammar is always generated as an internal class instead of a public class. * Rules within the imported grammar are always declared public since they are only called by the root grammar. How does that sound? Sam -Original

[il-antlr-interest: 32085] Re: [antlr-interest] Examples of semantic predicates with ...

2011-04-05 Thread Sam Harwell
Hi James, In this case, I'm dealing with semantic predicates of the form {...}? and gated semantic predicates of the form {...}?=. The ones you're using in this case are syntactic predicates, which aren't processed by the Boolean logic algorithm I've been working on recently. Sam -Original

[il-antlr-interest: 32088] Re: [antlr-interest] Which to use StringTempates version 3 or 4?

2011-04-05 Thread Sam Harwell
ST4 is *tremendously* faster than ST3 and includes the most useful debugger for any template engine I've seen to date. For a new application, it's not even a question IMO - definitely ST4. Sam -Original Message- From: antlr-interest-boun...@antlr.org

[il-antlr-interest: 32096] Re: [antlr-interest] AST cardinality from called rules

2011-04-05 Thread Sam Harwell
The AST operators are the most efficient manner: localVariableDeclaration : LOCAL^ variableDeclarationList ; variableDeclarationList : variableDcl ( ','! variableDcl )* ; Or use rewrites: localVariableDeclaration : LOCAL variableDeclarationList - ^(LOCAL

[il-antlr-interest: 32067] [antlr-interest] Examples of semantic predicates with extremely long generated code

2011-04-04 Thread Sam Harwell
Hi everyone, For certain cases of semantic predicates, ANTLR generates some *extremely* long, complicated, and redundant conditionals in the output code. I've been working on resolving this issue, and I'm looking for some examples of these grammars to make sure my updates properly reduce these

[il-antlr-interest: 32069] Re: [antlr-interest] Examples of semantic predicates with extremely long generated code

2011-04-04 Thread Sam Harwell
, at 9:58 AM, Sam Harwell wrote: Hi everyone, For certain cases of semantic predicates, ANTLR generates some *extremely* long, complicated, and redundant conditionals in the output code. I've been working on resolving this issue, and I'm looking for some examples of these grammars to make

[il-antlr-interest: 32073] Re: [antlr-interest] Examples of semantic predicates with extremely long generated code

2011-04-04 Thread Sam Harwell
Hi Loring, Yes, all my changes are in SemanticContext.cs (which will be SemanticContext.java in the Java version). Sam -Original Message- From: Loring Craymer [mailto:lgcray...@yahoo.com] Sent: Monday, April 04, 2011 12:50 PM To: Sam Harwell; Terence Parr; antlr-interest Interest

[il-antlr-interest: 32056] Re: [antlr-interest] [CSharp3] TraceIn/TraceOut and ANTLR_TRACE conditional

2011-04-02 Thread Sam Harwell
Hi Peter, The TraceIn/TraceOut methods in Parser and BaseRecognizer have different signatures (2 parameters vs. 3). The code generator emits calls to the one in Parser, which is supposed to forward the calls to BaseRecognizer. From what I can tell from the code generation templates, the methods

[il-antlr-interest: 32037] [antlr-interest] Problem and commentary on semantic predicates and prediction

2011-03-31 Thread Sam Harwell
I'm trying to use semantic predicates in a lexer. I'll try to explain everything as I walk through the things I tried. I started with this: TEXT : ( ~('}'|''|'\n'|'\r'|'\\'|''|'') | '\\' . | {AnonymousTemplateLevel==0}? '}' | {Outermost!=String}? '' |

[il-antlr-interest: 32038] Re: [antlr-interest] [stringtemplate-interest] Release of StringTemplate 4.0

2011-03-31 Thread Sam Harwell
Visualizer / inspector is very useful; check it out: http://www.antlr.org/wiki/display/ST4/StringTemplate+Inspector+GUI Ports to C#, Python, Objective-C on the way thanks to Sam Harwell, Benjamin Niemann, and Alan Condit. A big thanks to Udo Borkowski for his incredible bug catching

[il-antlr-interest: 32040] Re: [antlr-interest] Problem and commentary on semantic predicates and prediction

2011-03-31 Thread Sam Harwell
= '=' LA5_0 = '\u')) Sam -Original Message- From: Sam Harwell [mailto:sharw...@pixelminegames.com] Sent: Thursday, March 31, 2011 10:15 AM To: antlr-interest@antlr.org Subject: Problem and commentary on semantic predicates and prediction 4. The test (LA5_0 in SetB) expands

[il-antlr-interest: 32023] Re: [antlr-interest] antlr v4 wish list

2011-03-30 Thread Sam Harwell
Hi Martin, For lexers you can implement CharStream (ICharStream in the C# target), and for parsers you can implement TokenStream (ITokenStream in C# target). I've successfully used the former for case-insensitive lexing, and the latter for a preprocessor. ANTLRReaderStream is one of the included

[il-antlr-interest: 32027] Re: [antlr-interest] antlr v4 wish list

2011-03-30 Thread Sam Harwell
Fowles [mailto:matt.fow...@gmail.com] Sent: Wednesday, March 30, 2011 8:57 AM To: Sam Harwell Cc: Martin d'Anjou; antlr-interest@antlr.org Subject: Re: [antlr-interest] antlr v4 wish list Sam~ A token needs to know both start and end position. Especially when you add in the restriction

[il-antlr-interest: 32016] Re: [antlr-interest] antlr v4 wish list

2011-03-29 Thread Sam Harwell
Hi Martin, Replying to the individual points: 1. A token only needs to know the start position in the input stream and the length. Considering a file may easily have hundreds of thousands of tokens, it's very important to not add any information to the token that can be efficiently derived in

[il-antlr-interest: 31939] Re: [antlr-interest] [CSharp3] @namespace and composite grammars

2011-03-24 Thread Sam Harwell
Hi Ranco, As mentioned in the CSharp3 documentation, you need to use both @lexer::namespace{...} and @parser::namespace{...} in a composite grammar. If you use the templates included in my Visual Studio extension, then these are automatically inserted for you (including using the correct

[il-antlr-interest: 31941] Re: [antlr-interest] [CSharp3] @namespace and composite grammars

2011-03-24 Thread Sam Harwell
, 2011 9:12 AM To: Sam Harwell Cc: Ranco Marcus; antlr-interest@antlr.org Subject: Re: [antlr-interest] [CSharp3] @namespace and composite grammars @Sam, what is the name of the Visual Studio extension you are talking about? I tried to search for anything with ANTLR in it and it couldn't find

[il-antlr-interest: 31910] Re: [antlr-interest] [CSharp3] rule visibility in composite grammars

2011-03-23 Thread Sam Harwell
Hi Ranco, I'll add a simple delegate grammar example to the tests I use here and find a way to make it work. :) If you are using Visual Studio (or MSBuild in particular, which is the standard VS build system), then you'll definitely want to use the C# port of the tool. I highly recommend this

[il-antlr-interest: 31849] Re: [antlr-interest] @scopeinit, can find the post but nothing else.

2011-03-19 Thread Sam Harwell
Hi Eric, In the C# 3 documentation, section 4.4 discusses partial methods called when a scope object is created. http://www.antlr.org/download/CSharp3.pdf Thanks, Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of The

[il-antlr-interest: 31850] Re: [antlr-interest] C# tree parser memoize issue?

2011-03-19 Thread Sam Harwell
Hi David, Is there any way you can send me the full grammar you're using (you could send it to just me if you don't want to send it to the public list)? I don't use memoization in any of my grammars, so I don't have a way to test this feature extensively. Thanks, Sam -Original Message-

[il-antlr-interest: 31792] Re: [antlr-interest] CSharp3 Composite error

2011-03-11 Thread Sam Harwell
Hi Andrey, Thanks for the info. I'll see to getting it in for the next release. :) Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Andrey Sirotkin Sent: Friday, March 11, 2011 8:13 AM To: antlr-interest@antlr.org

[il-antlr-interest: 31733] Re: [antlr-interest] [SPAM] [SPAM] Re: C# Target: Problems with Mono

2011-03-05 Thread Sam Harwell
The CSharp2 target is currently broken, but it's in the process of getting fixed. The maintainer has been very busy, and it's been especially difficult given the extra features I've recently added to the CSharp3 target which aren't supported in C# 2. Sam -Original Message- From:

[il-antlr-interest: 31670] Re: [antlr-interest] [antlr-dev] Generated code checks for backtracking even though backtracking is off

2011-02-28 Thread Sam Harwell
Hi Susanna, Actions are not executed as part of a syntactic predicate. As a simplified example, take the following: rule : (x {Foo();}) = x; Foo() will not be called here, instead, you should write: rule : (x) = x {Foo();}; Sam From: antlr-dev-boun...@antlr.org

[il-antlr-interest: 31625] Re: [antlr-interest] C# antlr-dotnet-tool-3.3.1.7705 issue with collected template list

2011-02-25 Thread Sam Harwell
Hi David, Can you add the following template to the CSharp3 target's ST.stg which is used for generating code. Let me know if it resolves the issue for you. If this works, I'll clean it up (only overriding the necessary portion) and get it checked in for the next release. ruleLabelDefs() ::=

[il-antlr-interest: 31628] Re: [antlr-interest] AntlrWorks FEATURE REQUEST

2011-02-25 Thread Sam Harwell
This is exactly when creating an IDE you (IDE developer) should always include something like the following in the parse error handler (causing it cancel out of the entire parse operation): if (errorCount N) throw new OperationCanceledException(); :) Sam -Original Message- From:

[il-antlr-interest: 31636] Re: [antlr-interest] and, finally, ternary operator works

2011-02-25 Thread Sam Harwell
Ternary for C++ is even stranger, though I'm not sure it's necessary to support it at this point. x ? a : b = c should parse as this in C++: (? x a (= b c)) But as this is C (which is found to be invalid at a later time since the ternary operator cannot return an lvalue in C): (= (? x a b) c)

[il-antlr-interest: 31591] Re: [antlr-interest] Antlr 3.3, CSharp3 target, StringTemplate: Invalid code generated for a template rewrite

2011-02-24 Thread Sam Harwell
Hi Peter, This is fixed in the 3.3.1 release from last week. Here is a link to the instructions which I keep updated. It includes a link to release 3.3.1 in section 1.3. http://www.tunnelvisionlabs.com/downloads/antlr/ANTLRCSharp3_VS2010.xps Thanks, Sam -Original Message- From:

[il-antlr-interest: 31582] Re: [antlr-interest] ast rewrites in left-recursive rules

2011-02-23 Thread Sam Harwell
(Begin objective section) Inside the following rewrite: e : e '*' b=e - ^(...); e refers to the first e (the one right after the ':' in the rule) $e refers to the enclosing rule (the tree created so far) $b refers to the second e (the one labeled 'b=') This is never ambiguous because the

[il-antlr-interest: 31482] Re: [antlr-interest] Compile errors with CSharp2 Target

2011-02-16 Thread Sam Harwell
Hi Simon, Using the 3.3.1 build I posted last night, the only issue with the C# target is the use of {$channel=HIDDEN;}. To match .NET naming conventions, the hidden channel constant is Hidden, so they need to be changed to {$channel=Hidden;}. I updated the grammar you sent by: 1. Fixing the

[il-antlr-interest: 31483] Re: [antlr-interest] NPE when adding @header? (ANTLRWorks 1.4.2, Mac OSX 10.6.6)

2011-02-16 Thread Sam Harwell
Hi Bill, You need to place the @header block after the options{} block. Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Bill Schongar Sent: Wednesday, February 16, 2011 8:04 AM To: antlr-interest@antlr.org Subject:

[il-antlr-interest: 31497] Re: [antlr-interest] CSharp tool port

2011-02-16 Thread Sam Harwell
version of *Sam Harwell *C# port or the Antlr tool? *http://www.280z28.org/downloads/antlr/antlr-dotnet-binaries-3.2.0.6805.7z* Thanks, Chris List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address List: http

[il-antlr-interest: 31500] Re: [antlr-interest] Context Sensitive Keyword Support?

2011-02-16 Thread Sam Harwell
That's actually on my list of things to discuss when I'm there. :) Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Terence Parr Sent: Wednesday, February 16, 2011 5:43 PM To: antlr-interest Interest Subject: Re:

[il-antlr-interest: 31456] Re: [antlr-interest] Compile errors with CSharp2 Target

2011-02-15 Thread Sam Harwell
Hi Simon, I assume you're using the grammar from this project: http://code.google.com/p/phpparser/ If so, you'll need to modify the grammar to work with any target other than the Java target. In the @header and @members blocks at the top, the contained code is written in Java and will need to be

[il-antlr-interest: 31468] [antlr-interest] Updated C# port and CSharp3 target (C# build 3.3.1.7705)

2011-02-15 Thread Sam Harwell
for ANTLR grammars with your project. . Visual Studio 2010 highlighting and IntelliSense support for ANTLR v3 grammars and highlighting support for StringTemplate v4 group files. Thank you, Sam Harwell List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http

[il-antlr-interest: 31186] Re: [antlr-interest] Antlr 3.3 Generate wrong debug code C# target

2011-01-17 Thread Sam Harwell
Hi Max, The CSharp3 target does not currently support ANTLRWorks-style debugging. I'm planning to support debugging in a future release of the target. Thanks, Sam -Original Message- From: antlr-interest-boun...@antlr.org [mailto:antlr-interest-boun...@antlr.org] On Behalf Of

[il-antlr-interest: 31129] Re: [antlr-interest] Antrr 3.3 template Output

2011-01-11 Thread Sam Harwell
: Sam Harwell Subject: Antrr 3.3 template Output Hi, with Antlr 3.3 CSharp i try to use output = template, but generated class not compile because of a creation of STAttrMap object. Looking in the ST.stg at line 132 / 139 / 146 i found 3 template wich create a new istance of STAttrMap object, but i

[il-antlr-interest: 31083] Re: [antlr-interest] the nihilistic circle hoist

2011-01-05 Thread Sam Harwell
Here's my analysis of the problem. First and foremost, I'm treating the rule args as though it were written args : ID+; Problem 1: The rule args is not always executed behind the same predicate. This is easily corrected by adding a second rule args2 and modifying the element rule as follows:

[il-antlr-interest: 31050] Re: [antlr-interest] the nihilistic circle hoist

2011-01-02 Thread Sam Harwell
When a semantic predicate is involved with decision making in a grammar, the following rules should be considered absolute: 1. The predicate cannot access any argument to any rule. 2. The predicate cannot access any variables declared within an @init{} block of any rule. 3. The predicate cannot

  1   2   >