By Brandon Andrews

cornawakeSoftware and s/w Development

Nov 4, 2013 (3 years and 9 months ago)

112 views

CS 4800


By Brandon Andrews


Specifications


Goals


Applications


Design Steps


Testing



Create the grammar for a strongly typed
imperative language that merges
features of common languages like
ECMAscript
, and C# and others.


Braces language


Grammar will be in EBNF notation





To create a complete grammar for a
language.


Try to make it unambiguous if possible.


The languages could act as a scripting
language running in a virtual machine or
be compiled.


I plan to use it for a scripting language
for a game’s GUI.


Broken the design down into parts and
solved each part mostly separately.


Data Types, Allocators (new/delete when
not garbage collected), Constant Types,
Control Structures, Namespaces, OOP
(classes, methods, etc.),
Iterators
,
Exception Handling, Threading, Function
“Pointers”, Macro Preprocessor, and
Remote Procedure Call functionality built
into the language.


Strongly type


bool
, char, string,
uint
,
int
,
uint
<n>,
int
<n>, float,
double,
enum


Tuple

and
NamedTuple


Simple data types


Constant modifiers (apply to immediate right)


Reference types

int
<8>
foo

= 5; // can change

int
<8>&
foo

= bar; // can change

const
int
<8>
foo

= 5; // value can't change

int8 const&
foo

= bar; // reference can't


// change

const
int
<8> const&
foo

= bar; // reference and value


// can't change



if, else, while, for, do, switch, case, default,
break, continue



ECMAscript

and C# both have them


namespace Name { }


using Name;


Uses :: as the scope operator for
namespaces and classes.



Normal class structure


public, private, protected, static, abstract
modifiers


modifier class Name :
InheritedClass

… {
}



Methods with support for pass by value,
reference, and name allowing automatic
macro generation even at run
-
time.


Optional and Named parameters


void
Foo
(
int

foo
, name);


Where data types without types are pass by
name with explicit conversion from strings
for run
-
time purposes


Tuple

and “
NamedTuple
” return types
allowing things like:


return x, y; or return x:0, y:0;


foreach

mixed with the yield language
feature like in C# and Python


(yield can be abused, but it’s very
useful).



try, catch, finally, throw features


Designed in mind for user level and
kernel level threads.


Thread keyword with operations in it’s
class namespace like
Thread.Wait
(10); to
wait the
current thread.


Delegate system taken from C#.


Language feature like


#{ }


Allows for compile
-
time and run
-
time
compilation of code.


Complicated.


Allows Server and Client
communications seamlessly between
scripts.


Manual testing using sample programs.


While just being the grammar for the
language, the main goal later would be to
implement it for actual applications.



Currently most of the language features
are decided upon and the style for
certain parts of the grammar are
designed.