Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
User Journal

Journal I cant believe its n's Journal: HiLexed 2.0 - an update

Look-ahead generation is now completely automated. That is, it is precompiled on the first run, but can still be re-generated dynamically if confronted with some language that adapts how certain segments are to be parsed, for example after a function or variable declaration..

HiLexed can now compile semantic actions at any time (I could even allow these to change between invokations) and invoke as needed. Currently, only java is supported for these actions, but I am keeping my options open by making the decision on compilation strategy in a configuration file. Individual user projects should be able to override the default, but initially I will just create a working system.

Recursion is probably the final big problem to solve for this version. That is, I have parts of the problem solved, but the many different forms do not fit well together. The plan is to emulate the results of LR-parsing by annotating recursive segments with information on its form of recursion and by keeping track of recursive insertion points into the resulting list. Yes, results will be serialized since different languages have different priority for the same operators. I believe Smalltalk and NewSpeak are strictly left-to-right, whilst the wast majority of languages use standard arithmetic priority.

Upon entering a recursive segment selection, some segments are allowed and some disallowed. Upon exiting a recursive segment there is a certain set of allowed follow segments and for some even an exit segment. What is allowed differ depending on the annotations made earlier. Some segments are multi-recursive, directly or indirectly so the different rules have to be combined. Very complex but I believe solvable for deterministic grammars.
This discussion has been archived. No new comments can be posted.

HiLexed 2.0 - an update

Comments Filter:

Remember to say hello to your bank teller.

Working...