Lexer-Parser

Created at: Wednesday, 25 June 2025 3:02:00 am Last Modify: Wednesday, 25 June 2025 3:02:00 am

Here lies some my ideas of Lexer and Parser Design

Lexer Definition:

Match:

<item-id> <regex>

Id:

<item-id> <lex-id>

Enclosure:

<item-id> <regex-l-id> <regex-r-id>

Parser Definition:

LexIds:
<lex-item-id>

NodeIds: [--auto]
<node-id> [<number>]

Rule:

<rule-name>
:<match 1> =>{
    <action 0>
    <action 1>
    <...>
}
| <match 2> =>{
    <action 0>
    <action 1>
    <...>
};

Action:

<command> [para0 [para1 ...]]

Actions:

Generated in 16.9261 ms.

Mobile Version