[TYPO3-dev] TS compiler
Elmar Hinz
elmar.DOT.hinz at team.MINUS.red.DOT.net
Fri May 11 16:22:04 CEST 2007
>> To make it extendable and to keep the work on semantic low I think, one
>> shouldn't hardecode it all into the compiler but make it read from a kind
>> of configuration file for the semantics. But that requires to define an
>> additional grammer for this configuration file.
>
> Nice idea. The endless spiral - who verifyes the configuration file ;-)
> Jokes aside - this could prove usefull. Probably something to take into
> account in the design of TS 2.0 or whatever it's called for the T3 5.0 CMS?
>
Thinking this twice I don't think it belongs into the compiler, but should
be done in a completely separate module. It could be implemented in PHP
checking the generated PHP Array.
The semantics configuration could be done in TS pretty well, looking
similar to this:
objects {
HTML{
name = HTML
optionalProperties {
value {
name = value
required = 0
dataTypes = string, stdWrap
}
}
TEXT {
name = TEXT
optionalProperties {
value {
name = value
dataTypes = string
functions = stdWrap
}
dataTypes = stdWrap
}
...
}
functions {
stdWrap {
name = stdWrap
optionalProperties {
case {
name = cases
dataTypes = cases
}
lang {
name = lang
...
}
...
}
}
}
dataTypes {
cases {
name = cases
dataTypes{
enum.values = upper, lower
}
}
enum {
name = enum
requiredProperties = values
}
}
>> Not yet.
>
> But you actualy plan to do so? :-) I'm interested on an academic level as
Yes. I want to learn writing compilers and this belongs to the stuff I have
to practice.
> well, since I recently took a course in semantics and have written
> compilers before (just in ML which is very nice for compiler generation).
:-)
Regards
Elmar
More information about the TYPO3-dev
mailing list