[TYPO3-50-general] TypoScript 2.0 EBNF
robert at typo3.org
Tue Jun 12 10:40:45 CEST 2007
Am 12.06.2007 um 09:24 schrieb Christian Welzel:
> I do not think, that it complicates things. It even simplifies them.
> There are three big advanteges for using a lexer in a compiler
> (additionally to the better readability agains regexps):
> 1) you can implement the ebnf really straight forward if you
> have not to hassle with pattern matching in the parser.
> 2) a lexer+parser combo is faster than regexps.
> 3) things like
> blabla.value = "text 'text'"
> blabla.value ='small \'text'
> are handled by the lexer. you dont have to deal with it in the
I'm sure you're right with the scanner part - it will remove
comments, empty lines etc.
But I played a little with tokenizing the TypoScript and very soon
got the impression
that I'd have to produce a lot more code than with only regex.
If you like, please have a look at my current implementation . The
of about 400 lines of code at the moment and for me it still looks
especially when you see the EBNF defintion side by side with the code.
I suggest that I implement the remaining features and then I'd ask
you to review the
code and make improvements. Because we have the unit tests in place,
you can experiment
with speed- and other improvements without breaking things. How about
More information about the TYPO3-project-5_0-general