Skip to content

Instantly share code, notes, and snippets.

@rikkimax
Created January 7, 2018 18:03
Show Gist options
  • Save rikkimax/3b443e37288d3515f6c107d1eddf7b0d to your computer and use it in GitHub Desktop.
Save rikkimax/3b443e37288d3515f6c107d1eddf7b0d to your computer and use it in GitHub Desktop.

The language is composed of types, literals and statements. Types are a definition of what a literal can be.

Literals are:

- Number
- String
- Function body with prototype
- Reference to variable
- Initialized template
- Comment

Statements are composed of:

<name> [( [Text] )];
<name> [( [Text] )] <FunctionBody>

<Expression> [( [<Expression>,...] )];

<name> [<ExpressionOperator>]= <Expression>;

Expression

[(] <name> [)]
[(] <Expression> <ExpressionOperator> <Expression> [)]

ExpressionOperator

.
+
-
*
/
~
<<
>>
^
%
^^

Functions are defined as:

<return type> [name] ([<Type> <name>,...]) [Template] <FunctionBody>

and Function Bodies:

{

	<Type> <name> [ = <Literal>];
	
	<Type>
		<name> [ = <literal>],
		<name> [ = <literal>];
	
	<Function body>
	
	<Statement>
}

Unitialized templates can be placed upon function literals.

<!> [( TemplateArg,... )] [ if (<Expression>,...) ]

and TemplateArg:

<Type>
<TypeSpecialization2>
<Type> = <Type> [ : <Type> ]

Type specialization:

is( <TypeSpecialization2> )

and TypeSpecialization2 is:

<Type> : <Type>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment