[antlr-interest] CSharp 3.0 target

Ostrov, Alexei (GMIT-TASS) Alexei_Ostrov at ml.com
Mon Jan 14 13:25:57 PST 2008


Solution to the problem:

>From examples of code for 2.7.x I see that Lexer used to be the
ITokenSource. In 3.0 Lexer does not implement that interface any more.
Instead there is a shared state that carries this information. So,
instead of the private int type field in the myGenerateLexer I declared
	private int type
	{
		set{state.type=value;}
	}

This works; I can "recognize" things now.

Alexei

Alexei Ostrov
Desk A0513, 11th floor, 222 Broadway, NY, NY10038
212.670.1784
917.520.0205

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Ostrov, Alexei
(GMIT-TASS)
Sent: Monday, January 14, 2008 3:11 PM
To: antlr-interest at antlr.org
Subject: [antlr-interest] CSharp 3.0 target

Kunle, 

I apologize if I should be writing to a different place... If so, could
you please let me know?

I've generated the Lexer and Parser but they do not compile. In Lexer I
find the this.type variable. I defined it locally for now, but it
obviously is not right. From debugging I understand that this is the
type of the token, but because it is private it does not propagate to
the right place. I also do not see it defined anywhere in Lexer or
BaseParser as non-private field. I see it as property of Token, but am
not sure how it is supposed to get there. 
What am I doing wrong?

I am using 3.0.1 version. 

Thank you much, 

Alexei

Alexei Ostrov
Desk A0513, 11th floor, 222 Broadway, NY, NY10038
212.670.1784
917.520.0205
--------------------------------------------------------

This message w/attachments (message) may be privileged, confidential or
proprietary, and if you are not an intended recipient, please notify the
sender, do not use or share it and delete it. Unless specifically
indicated, this message is not an offer to sell or a solicitation of any
investment products or other financial product or service, an official
confirmation of any transaction, or an official statement of Merrill
Lynch. Subject to applicable law, Merrill Lynch may monitor, review and
retain e-communications (EC) traveling through its networks/systems. The
laws of the country of each sender/recipient may impact the handling of
EC, and EC may be archived, supervised and produced in countries other
than the country in which you are located. This message cannot be
guaranteed to be secure or error-free. This message is subject to terms
available at the following link:
http://www.ml.com/e-communications_terms/. By messaging with Merrill
Lynch you consent to the foregoing.
--------------------------------------------------------


More information about the antlr-interest mailing list