<$BlogRSDUrl$>

Saturday, June 07, 2003

IT'S ALIVE!


After running thru endless trace logs today, the parsing engine is working 100%. A simple C# file of 175 lines makes a trace log of almost 27 000 lines. Luckily the Total Commanders Lister viewer is lightning fast and makes finding something visually a painless experience. Next up, I'll add some profiling code, to assist in EBNF source file creation. I'm still wondering whether to make a AST or FileMap. Anyways, back to work!


Success!


The parser and logic engine has now been completed in both AsmL and C#. I currently test this to C# definition file I have managed to put together. Currently the AsmL code is only 270 lines and the C# code around 550 lines including some comments. Next step is to build either a "syntax" tree or a file map, but I am still a bit skeptical which one to use. I have even though of XML as a possiblity, perhaps a DataSet? We will have to wait and see, I first have run some more tests.


Thursday, June 05, 2003

Parser Update


I have been fooling myself in a sense. I was reinventing the wheel. But is this so bad when the wheel is in fact a simplification of RegEx. When I started doing this 2 weeks ago, I could barely write a line of RegEx. Now suddenly, I have learnt a simplification of Regex without touching RegEx and it now makes sense to me. Almost like the Neo oke from the Matrix. Even things that I never understood like DTD and XSL, suddenly made sense too. All to crown this all, I wrote 2 exams today as well.

Anyways, I have now decided after playing a bit more with AsmL to build a simple RegEx framework for AsmL. A parser should be a natural following to that; isnt that what RegEx is good for? LepEx seems an appropiate name for this too :)

Here is a little snippet:

structure Group extends Machine

case Repeater
count as Integer = 0
case Optional
actual as Boolean = false
case Iterator
count as Integer = 0

inner as Machines
grouptype as GroupType = And

GroupFormat() as (Format, Format)
match me
Repeater: return (LRep, RRep)
Optional: return (LOpt, ROpt)
Group : return (LGrp, RGrp)

SepFormat() as Format
match grouptype
And: return AndL
Or: return OrL
Not: return NotL

override ToFormat() as Format
(l,r) = GroupFormat()
return Format.List(l, SepFormat(), r, [ToFormat(i) | i in inner])


Sunday, June 01, 2003

AsmL update


I have managed to rewrite to logic engine in AsmL and reduced it size from roughly 1000 lines to about 100 in AsmL. Also, much less code generation is needed. Currently, I'm trying to a simplifying algorhytm to get rid of unneccesary grouping constructs. As the syntax of AsmL is still a bit new to me, I have tried doing this in C# rather. Again the AsmL solution is much simpler, but I am have some problems assigning the final bit. C# has proved to long in the tooth with endless casting.