Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-core-dev] ECJ scanner and parser - how to modify the scanner?

hi dear all actually i m a new user in eclipse and i m seriousely i m looking for org.eclipse.jdt.core.search but i couldnt find to download it even batch file, please help me in this case if its possible.
kindly regards
Omid

 
On 6/18/07, Marco Kaufmann <marco5327@xxxxxxxx> wrote:
Thanks, that helped :)

Stephan Herrmann < stephan@xxxxxxxxxxxxxxx> schrieb:
On Sunday 17 June 2007 11:55, Marco Kaufmann wrote:
> Hi,
>
> I'm currently working on a modified version of the ecj compiler and
> thereto need to modify the compiler's scanner and parser. That works
> fine for the parser: I use the java grammar file (grammar/java.g) from
> the reporsitory and jikespg to generate the parser source (or parts of
> it respectively), and the Parser.buildFilesFromLPG - method in order
> to generate the RSC files which contain the parser tables.
>
> However, I'm having a problem with the scanner. I can't create new
> keywords, because Parser.buildFilesFromLPG() generates only the
> parser table files, not the files for the scanner. These are (as I assume)
> part1.rsc, part14.rsc, part2.rsc, start1.rsc and start2.rsc . I found no
> method in Scanner.java which was similar to Parser.buildFilesFromLPG.
> Is there a way to generate the files nevertheless?
Do you already generate/update the file TerminalTokens.java?
(I currently don't have the link to the howto to check whether this step
is included in that document).

The scanner itself is implemented manually in class Scanner.
It has a method internalScanIdentifierOrKeyword() with a long switch
statement, that needs to be extended for new keywords.

Whenever you make changes to Scanner beware of a duplicate called
PublicScanner, which needs to be kept in sync with Scanner.

hope this helps,
Stephan

--
--------------------------------------------------------------------------
Dr. Stephan Herrmann
Organizing Chair of ECOOP 2007 (July 30 - August 3)
http://2007.ecoop.org
----------------
Technische Universität Berlin
Software Engineering Research Group
http://swt.cs.tu-berlin.de/~stephan
phone: ++49 30 314 73174
--------------------------------------------------------------------------


Der neue Internet Explorer 7 in deutscher Ausführung ist da !


_______________________________________________
jdt-core-dev mailing list
jdt-core-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jdt-core-dev




--
Omid Pourgalehdari
Electronic Engineering (PhD candidate)
Information Technology (M.Sc.)
Electronic Engineer (B.Sc)
Tel: (+60) 174833509
Email: galedari@xxxxxxxxx
          omid_g57@xxxxxxxxx

Back to the top