[antlr-interest] [stringtemplate-interest] StringTemplate editing in Visual Studio

Johannes Luber jaluber at gmx.de
Tue Oct 21 10:12:08 PDT 2008


Sam Harwell schrieb:
> Fresh port by hand using all ANTLR3 grammars. Hello C# 3.0 Extension
> Methods. :) I also have a C# 3 port of the ANTLR runtime using generics
> & Linq in places. I'm working on lazy evaluation of lexers in the
> parser, etc., but that isn't complete yet.
> 
> After the StringTemplate unit tests all passed (including fixing the
> '\n'/'\r\n' issues in the tests and implementation) I refactored some
> System.Collections.IDictionary and IList to generics. I'll be posting
> the StringTemplate source in the near future and keeping it updated.

So I guess you are willing to take the job as the StringTemplate
maintainer? The current one is practically unreachable and has basically
no time. I'm also interested in your port of the ANTLR runtime. I
haven't got around to improve on the runtime because of the license
issue, which my predecessor introduced, and I didn't want to start the
work if there was a chance that it was a waste of time.

Also I haven't heard of anyone needing the new features so there wasn't
much pressure doing so anyway. But now it seems the best course of
action to get rid of the main parts of the hassle with using your port.
BTW, you did you the correct license, didn't you? And did you use
"tainted" files as your base? I don't want to deal with the same
problems again. We can discuss the details of checking the files in the
perforce repo privately.

> The
> StringTemplate port happened because I'm working on a full ANTLR3 port
> to C# 3 so I can completely integrate the build, debugging, and new
> modular/extensible codegen optimization passes into my Visual Studio
> language service. Now that even Mono supports most (all?) of the
> relevant C# 3 features,

Mono doesn't support LINQ to SQL yet, but the rest of the 3.5 features
(but not the 3.0 ones) is there.

> I felt that was the best way to go on a fresh
> port. C# 2 users (Visual Studio 2005, etc) won't be able to compile the
> source within Visual Studio (command line works), but they *will* be
> able to reference/use it in their projects and even benefit from the new
> lazy evaluation features.

Just that I understand it correctly: VS 2005 users can merely compile
the runtime on the command line despite using C# 3 features? Can they
jump into the source code files while debugging? Is it possible to use
2.0 as the compile target for users of .NET 2 and the ones of .NET 3.5
at once? That would simplify the maintainence.

Johannes
> 
> And now I'm rambling. :o
> 
> Sam
> 
> -----Original Message-----
> From: Johannes Luber [mailto:jaluber at gmx.de] 
> Sent: Tuesday, October 21, 2008 11:18 AM
> To: Sam Harwell
> Cc: Terence Parr; stringtemplate-interest; antlr-interest Interest
> Subject: Re: [stringtemplate-interest] StringTemplate editing in Visual
> Studio
> 
> Sam Harwell schrieb:
>> I'm using a barely-modified group.g3 in my C# StringTemplate 3.2 port,
> 
> Did you add the missing stuff or did you port from Java directly? If the
> latter, did you do it manually or with a tool?
> 
> Johannes
>> and the colorizer uses it directly. As I was mentioning on my blog,
> the
>> key to using ANTLR lexers in a syntax highlighter making sure the
> lexer
>> can cleanly handle *any* single line of source without context other
>> than a single integer used for marking the state at the beginning of a
>> line.
>>
>> I'm working on a framework for automatic handling of island grammars
> in
>> this kind of line-by-line lexer, at which point I'll be able to
>> arbitrarily highlight any tokens of the StringTemplate sub-grammars.
>> You'll have to write your own highlighter since it won't be in Visual
>> Studio, but I can detail some of the method once it's up and running.
>>
>> Since many lexers use few (if any) actions, we've had remarkable
> success
>> getting new syntax highlighters up and running. Once I had the
>> StringTemplate C# port running, it took less than 2hrs to build the
>> syntax highlighter as it sits now.
>>
>> Sam
>>
>> -----Original Message-----
>> From: Terence Parr [mailto:parrt at cs.usfca.edu] 
>> Sent: Tuesday, October 21, 2008 10:34 AM
>> To: Sam Harwell
>> Cc: antlr-interest Interest; stringtemplate-interest
>> Subject: Re: [stringtemplate-interest] StringTemplate editing in
> Visual
>> Studio
>>
>> That looks great!  I was going to explore for ANTLRWorks sometime this
> 
>> year.  Great job...now I can copy you! ;)
>> Ter
>> On Oct 21, 2008, at 1:24 AM, Sam Harwell wrote:
>>
>>> I'm in the initial stages of the StringTemplate portion of an editor
> 
>>> for
>>> Visual Studio. At this point, it doesn't do anything crazy but I'm
>>> posting a screenshot to try and draw some feedback. Does anyone have
> 
>>> an
>>> idea what the syntax highlighting for StringTemplate should look like
>>> optimally? I have a few ideas I'll run with for now and hopefully
>>> they'll prove usable.
>>>
>>> The screenshot is under the StringTemplate section on this page:
>>>
> http://wiki.pixelminegames.com/index.php?title=Tools:nFringe:Antlr:Featu
>>> res
>>>
>>> On a side note, the current preview release (16251) doesn't include  
>>> the
>>> StringTemplate syntax highlighter. It'll be in the next one.
>>>
>>> Sam
>>> _______________________________________________
>>> stringtemplate-interest mailing list
>>> stringtemplate-interest at antlr.org
>>> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>> _______________________________________________
>> stringtemplate-interest mailing list
>> stringtemplate-interest at antlr.org
>> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>>
> 



More information about the antlr-interest mailing list