|
|
|
|
|
by avera
4022 days ago
|
|
I have my regex alternative version, currently in development, with C like syntax. Here is approximate sketch, how it looks. Goal is, that from this syntax I can get full, hierarchical AST for programming languages parsing:
http://pastebin.com/CFZf306p
- until it's done, some smaller details can change. Idea is that it can build multiple layers of matched items. In this example, layer 0 is "pattern lines"
then on top of this, gets mapped tokens representation at "parttern tokens". and lastly, over lines and tokens goes AST objects, which are represented by language code. Hierarchy and context-based patterns referencing and construction can be easily achieved. Ideally, I would like to build this with realtime update feature, when used in source code editor. In IDE, when I write some characters in code, these changes propagate into parsed layers objects and updates what is needed. |
|