lp:~psmay/+junk/mskp-parser.dev

Created by Peter S. May and last modified
Get this branch:
bzr branch lp:~psmay/+junk/mskp-parser.dev
Only Peter S. May can upload to this branch. If you are Peter S. May please log in for upload directions.

Related bugs

Related blueprints

Branch information

Owner:
Peter S. May
Status:
Development

Recent revisions

30. By Peter S. May <pmay@pmay-desktop>

* MskpWalkerSecond.g
 Fixed second walker to actually succeed in parsing the product of the first. At first glance the result is accurate. The parsing is very slow, probably due in some part to the fact that it has to perform recursive syntactic predicates to a somewhat deep level. Optimization will come later.

29. By Peter S. May <pmay@pmay-desktop>

* Mskp.g
 Added "promote" tokens to grammar to distinguish them from normal tags.

* MskpWalkerFirst.g
 Added "promote" tokens to grammar to distinguish them from normal tags.
 Adjusted walker to largely treat PROMOTE the same as TAG.
 Fixed the distributive tagging code so that new tree nodes are only created from adaptor.create(int,Token). Using adaptor.create(Token) was causing some frustrating errors; I think I may not understand its semantics.

28. By Peter S. May <http://psmay.com/>

* MskpWalkerSecond.g
 Added memoize=true. Didn't seem to do any good. This grammar is still a very rough draft and may have some inherent problems.

* DebugDriver.g
 Abstracted the tree-producing parsers into one single superclass whose objects already know which start rule to use. It actually works, unlike the previous iteration.

27. By Peter S. May <http://psmay.com/>

* MskpWalkerSecond.g
 BROKEN.
 A start on the second-level tree walker that should resolve promotes.

* build.xml
* DebugDriver.java
 Changed the debug grammar to MskpWalkerSecond.g. This didn't work the first time I tried it.

26. By Peter S. May <pmay@pmay-desktop>

* [MOVED] src/antlr/MskpWalkerDebug.g => src/antlr/MskpWalkerFirst.g
 This grammar will soon not be primarily for debugging.
 Name changed in grammar.

* [MOVED] src/java/org/halfgeek/mskp/parser/MskpWalkerDebugDriver.java => src/java/org/halfgeek/mskp/parser/DebugDriver.java
 This driver will be for general use, perhaps with other grammars.
 Code was refitted to reflect the change in attitude and is hopefully more expandable.

* build.xml
 Adjusted to make setting debug-compiled grammars easier within the file. I'm hoping there's a better way to do this.

25. By Peter S. May <pmay@pmay-desktop>

* input3.txt
 Added tests for tag defaulting/promotion behavior (i.e. if a list generated by a block contains exactly one element which is itself a list, the latter is promoted to replace the former).

* Mskp.g
 Elements that support promotion now generate a spread tag "(u)" (for "upgrade"). The tag name contains parens so that it is not possible to generate using other syntax.

* MskpWalkerDebug.g
 Now no list gets special behavior if empty.
 All lists produce a List tree where the List token is assigned "(...)".
 A new walker needs to be produced that processes promotion such that e.g. ^(Tag["(u)"] ^(List ^(List A B C))) is transformed to ^(List A B C).

24. By Peter S. May <http://psmay.com/>

* build.xml
 Added another task to clean to delete more ANTLRWorks intermediates.

* input3.txt
 Corrected an expression in the pseudo-JS.

* Mskp.g
 Untagged blocks now spread the tag "(auto)". Perhaps tagged blocks need to do this also.

23. By Peter S. May <pmay@pmay-desktop>

* input3.txt
 Updated JavaScript mock-ups to take advantage of new language features.

* Mskp.g
 Root now puts SPREAD instead of GROUP. Still an experiment that may be reverted.
 Basic lists and open lists are now tagged "()". This is also an experiment.

* MskpWalkerDebug.g
 Node generator for tagged lists has new topology which separates tags from list content.

22. By Peter S. May <pmay@pmay-desktop>

* Mskp.g
 Added a new subgrouping operator (another abuse of :) that allows the author to specify that the remainder of this sequence is actually a nested subsequence; for example A B : C D : E F -> A B (C D (E F)). This immediately makes return, var, throw, and similar unary operators less awkward to write (return : gcd a b, var i : gcd a b, throw : new Exception). The operator is also compatible with group tags, so a:b:c: d e f means the same as a:b:c:(d e f).

* input3.txt
 New cases added for subgrouping.

21. By Peter S. May <pmay@pmay-desktop>

* input3.txt
 Fixed the temporary lex adjustments; the lexer works fine now.

* Mskp.g
 Added BASIC token to replace TAG in some output.

* MskpWalkerDebug.g
 The AST output is now closer than ever to being roughly the intended output.
 There is now code that generates output trees from an action.
 Still to fix includes redundant () groupings.

* MskpWalkerDebugDriver.g
 Updated to match other updates.

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
This branch contains Public information 
Everyone can see this information.

Subscribers