Commit e6c1019f authored by jfschaefer's avatar jfschaefer
Browse files

introduce functor for FGrammars

parent 19d0a809
concrete FGrammarEng of FGrammar = MCatsEng, CatEng ** open ParadigmsEng, ResEng, Prelude in {
concrete FGrammarEng of FGrammar = FGrammarI, MCatsEng, CatEng ** open ParadigmsEng, ResEng, Prelude in {
oper
wrap_mml : Str -> Str -> Str = \wrapper,content -> wrapper + "(" ++ content ++ ")";
mkMathCN_sg : Str -> CN = \s -> lin CN { s = table { Sg => table { _ => s }; _ => table { _ => "???" } }; g = nonhuman };
lincat
FIdentifier = Str;
FNumeral = Str;
FBinRelation = Str;
FComplexIdentifier = Str;
FExpression = Str;
FStatement = Str;
lin
fidentifier_to_fcomplexidentifier i = wrap_mml "mi" i;
fnumeral_to_fexpression n = wrap_mml "mn" n;
fcomplexidentifier_to_fexpression c = c;
fexpression_row expr = wrap_mml "mrow" expr;
apply_bin_rel rel a b = wrap_mml "mrow" (a ++ (wrap_mml "mo" rel) ++ b);
fstatement_to_statement fstmt = lin Cl { s = table {
Pres => table {
Simul => table { CPos => table { _ => "$" ++ fstmt ++ "$" }; _ => table { _ => "???" } };
......
incomplete concrete FGrammarI of FGrammar = {
oper
wrap_mml : Str -> Str -> Str = \wrapper,content -> wrapper + "(" ++ content ++ ")";
lincat
FIdentifier = Str;
FNumeral = Str;
FBinRelation = Str;
FComplexIdentifier = Str;
FExpression = Str;
FStatement = Str;
lin
fidentifier_to_fcomplexidentifier i = wrap_mml "mi" i;
fnumeral_to_fexpression n = wrap_mml "mn" n;
fcomplexidentifier_to_fexpression c = c;
fexpression_row expr = wrap_mml "mrow" expr;
apply_bin_rel rel a b = wrap_mml "mrow" (a ++ (wrap_mml "mo" rel) ++ b);
fstatement_to_statement fstmt = lin Cl { s = table {
Pres => table {
Simul => table { CPos => table { _ => "$" ++ fstmt ++ "$" }; _ => table { _ => "???" } };
_ => table { _ => table { _ => "???" } } };
_ => table { _ => table { _ => table { _ => "???" } } } } };
fcomplexidentifier_to_identifer fci = { s = "$" ++ fci ++ "$"; m = one };
fexpr_fbinrel_fcid_fbinrel_fexpr_to_identifier a r1 b r2 c =
{ s = "$" ++ (wrap_mml "mrow" (a ++ (wrap_mml "mo" r1) ++ b ++ (wrap_mml "mo" r2) ++ c)) ++ "$"; m = one };
}
Supports Markdown
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