|
|
Index: Home | What Is Izumi | Misc Links | Random Thoughts | Too Much To Read | The Rant Vault | Quotes Dev: Projects | Ideas For Dev | Nerdkill | Rig | Hint
20050122 Warning: This project is indefinitely put on hold.
20040723
Define the Hint Bootstrap, a minimal set of execution unit with the most simple language possible yet generic to serve as a base for expansion.
20050830
One of the design goals is to be able to expand the language from within. The best way to achieve this is to define a minimalistic syntax for both lexer, grammar and semantics that is going to be hardcoded in a bootstrap parser. This syntax should be able to override itself. Thus the language can be implemented in two parts, one in the bootstrap and then the rest using the language itself.
Implementation should be in two parts:
20040723
TBD
20040424
20040425
Language semantics:
Language syntax (BNF) and interpretation:
:lexer: \:lexid\: lex-expr
:arith: expr + expr | expr - expr | expr * expr | expr / expr | \(expr\) | -expr (Source: Dragon book) :expr: arith | fcall | onew | fnew | var | num :var: id *( \. id ) ?array :array: \[ list \] | \[ \] :list: expr *( \, expr) :fcall: fname fparams :fname: id :fparams: *(expr) :affect: var = expr
:fnew: (\func | \function) ?var - farg - fbody \end :farg: *(id) :fbody: *(stmt)
:onew: \new var :onewi: \newi var array
:stmt: ( lexer | affect | expr ) [ ; \n ]
These are not perfect (and probably buggy) but will do for a start.
Note that :lex-expr: is not defined here.
20040508
Lexer tokens:
:binary-plus: + :binary-minus: - :binary-mult: * :binary-div:
:group-open: ( :group-close: ) :unary-minux: - :array-open: [ :array-close: ] :list-sep: , :affect-eq: = :func-decl: func | function :func-var: - :func-args: [ - \n ] :func-end: end :id-scope: . :stmt-end: [ ; \n ]
Note that new and newi should respectively match hint.new and hint.newi. They do not need to internal lexer-specific commands. That has the side effect that new and newi can be overriden by the local scope. No kidding.
20040723
Bootstrap Hint syntax:
These are defined as regexps (System.Text.RegularExpression.Regex is supported by the .Net Compact fx 1.1). No specific difference is made here between lexem and syntax rules definitions.
:ws: [ \t]+ :ws0: [ \t]* :lexid: [a-z]+ :lex-expr: .*$ :lexer: :lexid: ws0 lex-expr
:stmt: var-decl | fun-decl | expr
:expr: arith | fcall | var | num :arith: expr + expr | expr - expr | expr * expr | expr / expr | \(expr\) | -expr (Source: Dragon book)
:sep: [;\n]
:var-decl: \var ws name = expr sep
To do (sorted by priority)
20040508 [1.N] [2 p] Lexer: Minimal token table, reads from string & file via NUnit 20040508 [1.N] [2 p] Syntax: Structure grammar & AST, parse :arith: with numerals, create AST 20040508 [1.N] [2 p] VM: Structure VM, evaluate AST with :arith:
Working on (sorted by priority):
Done (sorted by date):
20040508 [1.F] [1 p] Specs: Defined lexer tokens. Updated bnf rules. 20040506 [1.F] [1 p] Specs: Define minimal language syntax and behavior. 20040425 [1.F] [1 p] Project: Create main test project with NUnit 20040425 [1.F] [1 p] Lexer: Create project 20040424 [1.F] [1 p] Project: Prepare project and plan document
|
|

This work is licensed by Raphaël Moll under a Creative Commons License.
|
|
| Color Theme: | Gray | Blue | Black | Sand | Khaki | Egg | None |
|
|
|
|