[[TOC]][[BackLinksMenu]] == (1) [wiki:NameSpaces Namespaces] == === (1.1) [wiki:DataTypes Data Types] === == (2) [wiki:TypeDefinition Types] == == (3) [wiki:EnumDefinition Enums] == == (4) [wiki:SignalDefinition Signals] == == (5) [wiki:SingletonDefinition Singletons] == == (6) [wiki:ClassDefinition Classes] == = (7) Expression Syntax = This is just an area in which I'm exploring a simple expression syntax ...[[BR]] I hope to determine which logic for expression is simply lexical, which goes in grammar, which in type system / checking. Add to this ideas of lexical hints, syntax hints, type hints and better error recovery etc etc etc == Here's an example of a simple syntax == {{{ operators := ( "+" | "-" | "*" | "/" | "%" | ":=" ); expression := ( identifier | constant | operator /* monadic */ expression ( operator /* diadic */ expression ) | "(" expression ")" ); }}} The above syntax should let you have any operator as either monadic or diadic ... and has no implicit precedence (ie the brackets are required to produce the precedence) This doesn't take into account whether an identifer is or isn't mutable ... and takes no account of contants not being mutable. == What does all this this mean? == Well if we don't mind having expressions like {{{ 3 := fred + (2 * -15) + *thing }}} Then it's accepable. == Some improvement == OK, well if we sp;it the operators into monadic, diadic or both then hat ''might'' help things somewhat. {{{ monadics := ( "-" | "!" ); diadics := ( "+" | "-" | "*" | "/" | "%" | ":=" ); bracedMonadic := ( "sizeof" | "typeof" | L-guillemet typename R-guillemet // CASTING ); expression := ( identifier | constant | ( monadics expression | bracedMonadic "(" expression ")" | expression ) ( ( diadics expression | expression ) ) | "(" expression ")" ); }}} which gives us the ability to specify a subset of monadic, diadic operators (infix notation) and a set of monadic braced expressions (apparently single parameter functions). This would show up the following errors in the syntax and not in the type checking {{{ freddy / * burt // ERROR at *, as * is not a monadic infix operator }}}