Commit 2c5cec0a authored by Quentin Hocquet's avatar Quentin Hocquet
Browse files

Remove scool compiler.

	Scool compiler has been moved into its own repository.

	* tools: Remove.
	* tools/test.yml: Remove.
	* tools/tests: Remove.
	* tools/tests/syntax error: Remove.
	* tools/tests/syntax error/wrong.scl: Remove.
	* tools/tests/parse-ref: Remove.
	* tools/tests/parse-ref/vardec.ref: Remove.
	* tools/tests/parse-ref/fundec.ref: Remove.
	* tools/tests/parse-ref/funcall_no-args.ref: Remove.
	* tools/tests/parse-ref/empty-class_dec.ref: Remove.
	* tools/tests/parse-ref/varinit.ref: Remove.
	* tools/tests/parse-ref/emtpy-class_dec.ref: Remove.
	* tools/tests/parse-ref/no-args_funtype.ref: Remove.
	* tools/tests/parse-ref/class_dec.ref: Remove.
	* tools/tests/parse-ref/manydec.ref: Remove.
	* tools/tests/parse-ref/wiki1.ref: Remove.
	* tools/tests/parse-ref/bi-exp.ref: Remove.
	* tools/tests/parse-ref/funcall.ref: Remove.
	* tools/tests/parse-ref/wiki2.ref: Remove.
	* tools/tests/parse-ref/function.ref: Remove.
	* tools/tests/parse-ref/consinit.ref: Remove.
	* tools/tests/parse-ref/wiki3.ref: Remove.
	* tools/tests/parse-ref/funtype.ref: Remove.
	* tools/tests/parse-ref/empty.ref: Remove.
	* tools/tests/parse-ref/type_static-call.ref: Remove.
	* tools/tests/parse-ref/guard.ref: Remove.
	* tools/tests/good: Remove.
	* tools/tests/good/type_static-call.scl: Remove.
	* tools/tests/good/guard.scl: Remove.
	* tools/tests/good/vardec.scl: Remove.
	* tools/tests/good/fundec.scl: Remove.
	* tools/tests/good/funcall_no-args.scl: Remove.
	* tools/tests/good/varinit.scl: Remove.
	* tools/tests/good/empty-class_dec.scl: Remove.
	* tools/tests/good/manydec.scl: Remove.
	* tools/tests/good/no-args_funtype.scl: Remove.
	* tools/tests/good/class_dec.scl: Remove.
	* tools/tests/good/wiki1.scl: Remove.
	* tools/tests/good/funcall.scl: Remove.
	* tools/tests/good/bi-exp.scl: Remove.
	* tools/tests/good/function.scl: Remove.
	* tools/tests/good/wiki2.scl: Remove.
	* tools/tests/good/consinit.scl: Remove.
	* tools/tests/good/wiki3.scl: Remove.
	* tools/tests/good/funtype.scl: Remove.
	* tools/tests/good/empty.scl: Remove.
	* tools/transformer: Remove.
	* tools/transformer/scoolc.str: Remove.
	* tools/transformer/Makefile: Remove.
	* tools/scoolc: Remove.
	* tools/gen.yml: Remove.
	* tools/parser: Remove.
	* tools/parser/grammar: Remove.
	* tools/parser/grammar/Class.sdf: Remove.
	* tools/parser/grammar/Decl.sdf: Remove.
	* tools/parser/grammar/Exp.sdf: Remove.
	* tools/parser/grammar/Scool.sdf: Remove.
	* tools/parser/grammar/ExpOrType.sdf: Remove.
	* tools/parser/grammar/Type.sdf: Remove.
	* tools/parser/grammar/Lexical.sdf: Remove.
	* tools/parser/grammar/Guard.sdf: Remove.
	* tools/parser/grammar/Stm.sdf: Remove.
	* tools/parser/parse-scool: Remove.
	* tools/parser/Makefile: Remove.
	* tools/Makefile: Remove.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@506 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 5a459e32
2006-06-26 Quentin Hocquet <quentin.hocquet@lrde.epita.fr>
Remove scool compiler.
Scool compiler has been moved into its own repository.
* tools: Remove.
* tools/test.yml: Remove.
* tools/tests: Remove.
* tools/tests/syntax error: Remove.
* tools/tests/syntax error/wrong.scl: Remove.
* tools/tests/parse-ref: Remove.
* tools/tests/parse-ref/vardec.ref: Remove.
* tools/tests/parse-ref/fundec.ref: Remove.
* tools/tests/parse-ref/funcall_no-args.ref: Remove.
* tools/tests/parse-ref/empty-class_dec.ref: Remove.
* tools/tests/parse-ref/varinit.ref: Remove.
* tools/tests/parse-ref/emtpy-class_dec.ref: Remove.
* tools/tests/parse-ref/no-args_funtype.ref: Remove.
* tools/tests/parse-ref/class_dec.ref: Remove.
* tools/tests/parse-ref/manydec.ref: Remove.
* tools/tests/parse-ref/wiki1.ref: Remove.
* tools/tests/parse-ref/bi-exp.ref: Remove.
* tools/tests/parse-ref/funcall.ref: Remove.
* tools/tests/parse-ref/wiki2.ref: Remove.
* tools/tests/parse-ref/function.ref: Remove.
* tools/tests/parse-ref/consinit.ref: Remove.
* tools/tests/parse-ref/wiki3.ref: Remove.
* tools/tests/parse-ref/funtype.ref: Remove.
* tools/tests/parse-ref/empty.ref: Remove.
* tools/tests/parse-ref/type_static-call.ref: Remove.
* tools/tests/parse-ref/guard.ref: Remove.
* tools/tests/good: Remove.
* tools/tests/good/type_static-call.scl: Remove.
* tools/tests/good/guard.scl: Remove.
* tools/tests/good/vardec.scl: Remove.
* tools/tests/good/fundec.scl: Remove.
* tools/tests/good/funcall_no-args.scl: Remove.
* tools/tests/good/varinit.scl: Remove.
* tools/tests/good/empty-class_dec.scl: Remove.
* tools/tests/good/manydec.scl: Remove.
* tools/tests/good/no-args_funtype.scl: Remove.
* tools/tests/good/class_dec.scl: Remove.
* tools/tests/good/wiki1.scl: Remove.
* tools/tests/good/funcall.scl: Remove.
* tools/tests/good/bi-exp.scl: Remove.
* tools/tests/good/function.scl: Remove.
* tools/tests/good/wiki2.scl: Remove.
* tools/tests/good/consinit.scl: Remove.
* tools/tests/good/wiki3.scl: Remove.
* tools/tests/good/funtype.scl: Remove.
* tools/tests/good/empty.scl: Remove.
* tools/transformer: Remove.
* tools/transformer/scoolc.str: Remove.
* tools/transformer/Makefile: Remove.
* tools/scoolc: Remove.
* tools/gen.yml: Remove.
* tools/parser: Remove.
* tools/parser/grammar: Remove.
* tools/parser/grammar/Class.sdf: Remove.
* tools/parser/grammar/Decl.sdf: Remove.
* tools/parser/grammar/Exp.sdf: Remove.
* tools/parser/grammar/Scool.sdf: Remove.
* tools/parser/grammar/ExpOrType.sdf: Remove.
* tools/parser/grammar/Type.sdf: Remove.
* tools/parser/grammar/Lexical.sdf: Remove.
* tools/parser/grammar/Guard.sdf: Remove.
* tools/parser/grammar/Stm.sdf: Remove.
* tools/parser/parse-scool: Remove.
* tools/parser/Makefile: Remove.
* tools/Makefile: Remove.
2006-06-26 Quentin Hocquet <quentin.hocquet@lrde.epita.fr>
Remove external link to transformers.
......
all:
cd parser && make
cd transformer && make
clean:
rm -rf log.*
cd parser && make clean
cd transformer && make clean
check: all
uttk test.yml
gen: all
uttk gen.yml
---
Autogeneration of the Scool parser references: !S::Suite
contents:
- Generation: !S::Iterate
over: !pathlist <<pwd>>/tests/good/(*).scl
iter: [it_file, it_name]
test:
Generation <<it_name>>: !S::Cmd
command: parser/parse-scool "<<it_file>>" > "<<pwd>>/tests/good/<<it_name>>.ref"
SDF = $(wildcard grammar/*.sdf)
OUT = Scool
all: Scool.def Scool.tbl Scool.str
Scool.def: $(SDF)
pack-sdf -i grammar/Scool.sdf -o $@
Scool.tbl: Scool.def
sdf2table -i $< -o $@ -m Scool
Scool.rtg: Scool.def
sdf2rtg -i $< -m Scool -o $@
Scool.str: Scool.rtg
rtg2sig --module Scool -i $< -o $@
clean:
rm -rf Scool.* log.*
module Class
imports
Lexical Decl
exports
sorts Class AccessBlock AccessModifier
context-free syntax
"{" AccessBlock* "}" -> Class {cons("Class")}
AccessModifier "{" Decl* "}" -> AccessBlock {cons("Accessblock")}
"public" -> AccessModifier {cons("Public")}
"protected" -> AccessModifier {cons("Protected")}
"private" -> AccessModifier {cons("Private")}
lexical restrictions
AccessModifier -/- [A-Za-z]
module Decl
imports
Lexical Type Guard Stm
exports
sorts Decl
context-free syntax
"var" Id ":" Type ";" -> Decl {cons("VarDec")}
"var" Id ":" Type ":=" Exp ";" -> Decl {cons("VarDec")}
Id ":" Type "=" Exp ";" -> Decl {cons("ConsDec")}
Id ":" Type ";" -> Decl {cons("ConsDec")}
Id ":" "(" {(Id ":" Type) ","}* ")" "->" Type
"=" "{" Stm* "}" -> Decl {cons("FunDec")}
Id ":" "[" {(Id ":" Type Guard) ","}* "]" "->" Type
"=" "{" Stm* "}" -> Decl {cons("StaticFunDec")}
Id ":" "[" {(Id ":" Type Guard) ","}* "]" "(" {(Id ":" Type) ","}* ")" "->" Type
"=" "{" Stm* "}" -> Decl {cons("BiFunDec")}
Id ":" "(" {(Id ":" Type) ","}* ")" "->" Type
"=>" Exp -> Decl {cons("FunDec")}
Id ":" "[" {(Id ":" Type Guard) ","}* "]" "->" Type
"=>" Exp -> Decl {cons("StaticFunDec")}
Id ":" "[" {(Id ":" Type Guard) ","}* "]" "(" {(Id ":" Type) ","}* ")" "->" Type
"=>" Exp -> Decl {cons("BiFunDec")}
"decl" Id ":" "(" {(Type | (Id ":" Type)) ","}* ")"
"->" Type ";" -> Decl {cons("FunPreDec")}
Id ":" "[" {(Id ":" Type) ","}* "]" "->" Type
"=" "{" Stm* "}" -> Decl {cons("StaticFunDec")}
Id ":" "[" {(Id ":" Type) ","}* "]" "(" {(Id ":" Type) ","}* ")" "->" Type
"=" "{" Stm* "}" -> Decl {cons("BiFunDec")}
Id ":" "[" {(Id ":" Type) ","}* "]" "->" Type
"=>" Exp -> Decl {cons("StaticFunDec")}
Id ":" "[" {(Id ":" Type) ","}* "]" "(" {(Id ":" Type) ","}* ")" "->" Type
"=>" Exp -> Decl {cons("BiFunDec")}
\ No newline at end of file
module Exp
imports
Lexical Type ExpOrType Class
exports
sorts Exp
context-free syntax
ExpOrType -> Exp
Int -> Exp {cons("Int")}
String -> Exp {cons("String")}
Id "(" {Exp ","}* ")" -> Exp {cons("FunCall")}
Id "[" {Exp ","}* "]"
"(" {Exp ","}* ")" -> Exp {cons("BiFunCall")}
Exp "+" Exp -> Exp {cons("Sum")}
Exp "-" Exp -> Exp {cons("Sub")}
Exp "*" Exp -> Exp {cons("Mul")}
Exp "/" Exp -> Exp {cons("Div")}
Exp "=" Exp -> Exp {cons("Eq")}
Exp "!=" Exp -> Exp {cons("Neq")}
Exp "<" Exp -> Exp {cons("Inf")}
Exp ">" Exp -> Exp {cons("Sup")}
Exp ">=" Exp -> Exp {cons("SupEq")}
Exp "<=" Exp -> Exp {cons("InfEq")}
Exp ":=" Exp -> Exp {cons("Affect")}
Class -> Exp
Exp "." Id -> Exp {cons("Field")}
Id "." Id "(" {Exp ","}* ")" -> Exp {cons("MethodCall")}
context-free priorities
{left:
Exp "/" Exp -> Exp
Exp "*" Exp -> Exp
}
> {left:
Exp "+" Exp -> Exp
Exp "-" Exp -> Exp
}
> {right:
Exp ":=" Exp -> Exp
}
\ No newline at end of file
module ExpOrType
imports
Lexical Exp
exports
sorts ExpOrType
context-free syntax
Id "[" {Exp ","}* "]" -> ExpOrType {cons("StaticFunCall")}
Id -> ExpOrType {cons("Var")}
Id "::" Exp -> ExpOrType {cons("Scope")}
module Guard
imports
Exp
exports
sorts Guard
context-free syntax
"where" Exp -> Guard {cons("Guard")}
module Lexical
exports
sorts Id Int String Asterisk Slash BlockComment CommentPart Cpp
lexical syntax
[A-Za-z][A-Za-z0-9\_]* -> Id {cons("Id")}
[0-9]+ -> Int {cons("Int")}
"\"" [A-Za-z0-9]* "\"" -> String {cons("String")}
"//" ~[\n]* [\n] -> LAYOUT
[\ \t\n] -> LAYOUT
"/+" ~[]* "+/" -> Cpp
"class" -> Id {reject}
BlockComment -> LAYOUT
"/*" CommentPart* "*/" -> BlockComment
~[\/\*] -> CommentPart
Asterisk -> CommentPart
Slash -> CommentPart
BlockComment -> CommentPart
[\/] -> Slash
[\*] -> Asterisk
lexical restrictions
Id -/- [A-Za-z]
Asterisk -/- [\/]
Slash -/- [\*]
module Scool
imports
Decl
exports
sorts Program
context-free start-symbols Program
context-free syntax
Decl* -> Program {cons("Program")}
module Stm
imports
Lexical Exp Decl
exports
sorts Stm
context-free syntax
";" -> Stm {cons("EmptyStm")}
Exp ";" -> Stm {cons("ExpStm")}
"->" Exp ";" -> Stm {cons("Return")}
"{" Stm* "}" -> Stm {cons("Block")}
"if" "(" Exp ")" Stm ("else" Stm)? -> Stm {cons("If")}
"while" "(" Exp ")" Stm -> Stm {cons("While")}
Decl -> Stm
Cpp -> Stm {cons("CppStm")}
module Type
imports
ExpOrType
exports
sorts Type
context-free syntax
ExpOrType -> Type
"(" {Type ","}* ")" "->" Type -> Type {cons("FunType")}
"[" {Type ","}* "]" "->" Type -> Type {cons("StaticFunType")}
"[" {Type ","}* "]"
"(" {Type ","}* ")" "->" Type -> Type {cons("BiFunType")}
"class" -> Type {cons("Class")}
"class" "<" Type -> Type {cons("Class")}
#!/bin/sh
# -*- sh -*-
if [ $# -eq 0 ]; then
echo "usage: parse-scool file.scl"
else
sglri -p parser/Scool.tbl -i $1
fi
#!/bin/sh
# -*- sh -*-
parser/parse-scool $1 | transformer/scoolc
---
Test of the Scool parser: !S::Suite
contents:
- Valid input tests: !S::Iterate
over: !pathlist <<pwd>>/tests/good/(*).scl
iter: [it_file, it_name]
test:
Test <<it_name>>: !S::Cmd
command: parser/parse-scool "<<it_file>>"
exit: 0
output: !path "tests/parse-ref/<<it_name>>.ref"
- Wrong input tests: !S::Iterate
over: !pathlist "<<pwd>>/tests/syntax error/(*).scl"
iter: [it_file, it_name]
test:
Test <<it_name>>: !S::Cmd
command: parser/parse-scool "<<it_file>>"
exit: 1
i : int = pow[4](3);
\ No newline at end of file
point : class =
{
public
{
x : () -> int =
{
-> x;
}
}
private
{
var x :int;
var y :int;
}
};
\ No newline at end of file
i : int = 3;
\ No newline at end of file
foo : class = {};
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment