Implement basic functions (no parameters yet)
This commit is contained in:
31
IBAF-cbs/IBAF/IBAF-Start/IBAF-Functions.cbs
Normal file
31
IBAF-cbs/IBAF/IBAF-Start/IBAF-Functions.cbs
Normal file
@@ -0,0 +1,31 @@
|
||||
//Syntax
|
||||
//MD:
|
||||
// method-declaration ::=
|
||||
// 'public' type identifier '(' formal-list? ')' '{'
|
||||
// var-declaration*
|
||||
// statement*
|
||||
// 'return' expression ';'
|
||||
// '}'
|
||||
//
|
||||
//Type
|
||||
// methods
|
||||
// ~> functions(tuples(references(objects), minijava-values*), minijava-values)
|
||||
//
|
||||
//Semantics
|
||||
// declare-methods[[MD*:method-declaration*]] : => envs
|
||||
//Rule
|
||||
// declare-methods[['public' T ID '(' FL? ')' '{' VD* S* 'return' E ';' '}']] =
|
||||
// { id[[ID]] |->
|
||||
// function closure scope (
|
||||
// collateral ( // variables not allowed to shadow visible fields
|
||||
// match ( given,
|
||||
// tuple (
|
||||
// pattern abstraction { "this" |-> allocate-initialised-variable ( pointers(objects), given ) },
|
||||
// bind-formals[[FL?]]
|
||||
// )
|
||||
// ),
|
||||
// object-single-inheritance-feature-map checked dereference first tuple-elements given,
|
||||
// declare-variables[[VD*]] ),
|
||||
//
|
||||
// sequential ( execute[[S*]], evaluate[[E]] ) ) }
|
||||
|
||||
Reference in New Issue
Block a user