Re: [TCS] TCS reference [message #376936] |
Wed, 02 May 2007 13:56 |
Frédéric Jouault Messages: 572 Registered: July 2009 |
Senior Member |
|
|
Hello,
I am putting the eclipse.modeling.gmt newsgroup in copy of my answer,
because TCS is not part of the M2M project.
There is currently not much more publicly available information than
what is on the wiki page of TCS. However, we are currently working on
improving this.
There have already been several TCS-related posts in the GMT newsgroup
and on the old ATL mailing list (archives available from:
http://www.sciences.univ-nantes.fr/lina/atl/www/atl_discussi on_archive/).
They may contain information you need.
Do not hesitate to ask your TCS-related questions on the
eclipse.modeling.gmt newsgroup. Please, remember to prefix the subject
of your posts with [TCS] so that everybody knows what they are about :-).
To answer your questions:
- The lexer block is directly copied in the ANTLR grammar generated by
TCS (for more information, see
http://antlr.org/doc/lexer.html#Lexical_Analysis_with_ANTLR). "Symbols"
and "tokens" (see below) are appended to the lexer block.
- The operatorTemplate construct is used to define expressions (e.g., 1
+ 2 * 3) along with operator priorities.
- There are two places where "token" is used in TCS:
- in primitiveTemplates (these are used to match primitive types such
as Integer, and String to lexer terminals),
- to define lexer terminals directly in TCS rather than having to
write ANTLR code (e.g., it should be more portable to other parser
generators, and possibly simpler in some cases). However, this feature
is still being tested, and may not completely work yet.
My advice is that if you can live with the default lexer (i.e., single
quoted Strings, --.*\n comments, etc.), then keep it as is, at least in
the beginning of your project (you can still improve it later).
Regards,
Frédéric Jouault
Lorenzo Dalla Vecchia wrote:
> Hello everyone.
>
> I am currently approaching TCS and I was wondering if there's more
> reference material available than the files linked at
> http://wiki.eclipse.org/index.php/TCS .
> For example I do not understand the "lexer" block, the operatorTemplate
> and the "token" lines.
> Could you please point me in the right direction?
>
> Thanks.
>
> --
> Lorenzo
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03458 seconds