[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[xtext-dev] [Experimental] Packrat parser
|
Hi everybody,
I made the packrat parser compatible to our Xtext resource
implementation. From now on, you can optionally use our own parser
generator instead of Antlr. All you have to do, is to set a system
property that forces the packrat parser to be used:
-Dorg.eclipse.xtext.parser=packrat
What happens, if you decide to use this param?
The SwitchingParser, that is injected into our resource (it is the
last IParser implementation, that is registered - you get some
warnings because the service registry thinks multiple implementations
for the same interface were registered by mistake), will normally
delegate to an IAntlrParser. But when the system property was properly
set, the SwitchingParser will redirect to the IPackratParser to create
the semantic model and the node tree.
You don't have to regenerate or rebuild something - set the property
(or unset it) and restart your application and Xtext will use the one
or the other parser.
Note: Although possible it is currently discouraged to use the packrat
parser, because you will get much better error handling when you use
the Antlr parser.
Regards,
Sebastian
--
Sebastian Zarnekow
mobile: +49 (0) 151 / 1739 6724
phone: +49 (0) 431 / 5606-338
fax: +49 (0) 431 / 5606-339
web: http://www.itemis.de
mail: Sebastian.Zarnekow@xxxxxxxxx
xing: http://www.xing.com/profile/Sebastian_Zarnekow
itemis AG
Schauenburgerstraße 116
24118 Kiel
Germany
Rechtlicher Hinweis:
Amtsgericht Dortmund, HRB 20621
Vorstand: Wolfgang Neuhaus, Jens Wagner, Dr. Georg Pietrek
Aufsichtsrat: Prof. Dr. Burkhard Igel (Vors.), Stephan Grollmann,
Michael Neuhaus