init commit again
This commit is contained in:
17
IBAF-cbs/.project
Normal file
17
IBAF-cbs/.project
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>IBAF-cbs</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.metaborg.spoofax.eclipse.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.metaborg.spoofax.eclipse.nature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
1
IBAF-cbs/Funcons-beta
Symbolic link
1
IBAF-cbs/Funcons-beta
Symbolic link
@@ -0,0 +1 @@
|
||||
/home/peter/cbs-all/CBS-beta/Funcons-beta
|
||||
47
IBAF-cbs/IBAF/IBAF-Start/IBAF-Start.cbs
Normal file
47
IBAF-cbs/IBAF/IBAF-Start/IBAF-Start.cbs
Normal file
@@ -0,0 +1,47 @@
|
||||
Language "IBAFlang"
|
||||
|
||||
Syntax START:start ::= exp
|
||||
|
||||
Semantics start[[ _:start ]] : =>values
|
||||
|
||||
Rule start[[ E ]] =
|
||||
initialise-binding finalise-failing eval[[ E ]]
|
||||
|
||||
Syntax E:exp ::= int
|
||||
| id
|
||||
| 'lambda' id '.' exp
|
||||
| exp '(' exp ')'
|
||||
| 'let' id '=' exp 'in' exp
|
||||
| '(' exp ')'
|
||||
|
||||
Semantics eval[[ _:exp ]] : => values
|
||||
|
||||
Rule eval[[ N ]] = int[[ N ]]
|
||||
|
||||
Rule eval[[ X ]] = bound id[[ X ]]
|
||||
|
||||
Rule eval[[ 'lambda' X '.' E ]] =
|
||||
function closure
|
||||
scope( bind( id[[ X ]], given ),
|
||||
eval[[ E ]] )
|
||||
|
||||
Rule eval[[ E1 '(' E2 ')' ]] =
|
||||
apply( eval[[ E1 ]], eval[[ E2 ]] )
|
||||
|
||||
Rule eval[[ 'let' X '=' E1 'in' E2 ]] =
|
||||
scope( bind( id[[ X ]], eval[[ E1 ]] ),
|
||||
eval[[ E2 ]] )
|
||||
|
||||
Rule eval[[ '(' E ')' ]] = eval[[ E ]]
|
||||
|
||||
|
||||
Lexis N:int ::= ('0'-'9')+
|
||||
|
||||
Semantics int[[ N:int ]] : => integers
|
||||
= decimal \"N\"
|
||||
|
||||
|
||||
Lexis X:id ::= ('a'-'z') ('a'-'z'|'0'-'9')*
|
||||
|
||||
Semantics id[[ X:id ]] : => identifiers
|
||||
= \"X\"
|
||||
Binary file not shown.
Reference in New Issue
Block a user