init commit again

This commit is contained in:
Peter
2023-11-01 09:24:46 +01:00
commit 42da98a132
34 changed files with 1786 additions and 0 deletions

17
IBAF-cbs/.project Normal file
View 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
View File

@@ -0,0 +1 @@
/home/peter/cbs-all/CBS-beta/Funcons-beta

View 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\"