Beta

Slashdot: News for Nerds

×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

HiLexed 2.0 - an update

I cant believe its n (1103137) writes | more than 5 years ago

User Journal 0

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..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.

cancel ×

0 comments

Check for New Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Create a Slashdot Account

Loading...