====== NXML ====== Neko sources syntax is easy to read but can sometimes be difficult to generate. Also, it does not permit embedding file and line numbers informations. For example if your generate from a file in your language ''MyFile.mylang'' to ''myfile.neko'' you would like to get errors traces in terms of position in the original ''MyFile.mylang'' file. For these reasons, an extension of the neko syntax is allowed which is called NXML. This is not a different format in sense that you easily mix NXML and Neko sources together. You can put some NXML expressions in Neko sources and some Neko sources into an NXML document. NXML is based on XML and is representing a Neko Abstract Syntax Tree (AST). ====== NXML Nodes ====== NXML is not a different Neko syntax but a syntax extension. It means that you can put some NXML expressions inside a Neko program and some Neko program inside NXML as well. In order to use the NXML syntax you need to start with '''' and finish with ''''. All NXML nodes inside are Neko expressions. An NXML block is like a Neko block. For example '''' is the equivalent of the empty Neko block ''{ }''. Other nodes are the following : * '''' the literal integer 3 * '''' the literal float 1.5 * '''' the literal string ''a string'' * '''' the identifier ''id'' (includes special identifiers such as null, true, false and this) * ''e1 e2 e3...'' a block having several subexpressions * ''

e

'' parenthis around a subexpression * ''e'' field access of a subexpression ''(e).field'' * ''e0 e1 e2 e3...'' call of ''e0(e1,e2,e3...)'' * ''e1 e2'' array access ''e1[e2]'' * ''e'' local variable declaration, equivalent of ''var x = e, y'' * ''e1 e2'' while loop : ''while e1 e2'' * ''e1 e2'' do...while loop : ''do e1 while e2'' * ''e0 e1'' equivalent of ''if e0 e1'' * ''e0 e1 e2'' equivalent of ''if e0 e1 else e2'' * ''e1 e2'' a binary operation such as ''e1 * e2'' * ''e1 e2'' a try..catch block ''try e1 catch exc e2'' * ''e'' a function declaration such as ''function(x,y,z) e'' * '''' the return statement without expression * ''e'' return of an expression value * '''' the break statement without expression * ''e'' break with an expression value * '''' the continue statement * ''e1 e2'' a way to tie two expressions together (such as ''e1;e2'') * ''