summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FILES260
-rw-r--r--src/HelpFile693
-rw-r--r--src/Makefile250
-rw-r--r--src/Makefile.binary20
-rw-r--r--src/PGF/doc/Eng.gf13
-rw-r--r--src/PGF/doc/Ex.gf8
-rw-r--r--src/PGF/doc/Swe.gf13
-rw-r--r--src/PGF/doc/Test.gf64
-rw-r--r--src/PGF/doc/gfcc.html809
-rw-r--r--src/PGF/doc/gfcc.txt712
-rw-r--r--src/PGF/doc/old-GFCC.cf50
-rw-r--r--src/PGF/doc/old-gfcc.txt656
-rw-r--r--src/PGF/doc/syntax.txt180
-rw-r--r--src/ReleaseProcedure153
-rw-r--r--src/compiler/GF.hs (renamed from src/GF.hs)0
-rw-r--r--src/compiler/GF/Command/Abstract.hs (renamed from src/GF/Command/Abstract.hs)0
-rw-r--r--src/compiler/GF/Command/Commands.hs (renamed from src/GF/Command/Commands.hs)0
-rw-r--r--src/compiler/GF/Command/Importing.hs (renamed from src/GF/Command/Importing.hs)0
-rw-r--r--src/compiler/GF/Command/Interpreter.hs (renamed from src/GF/Command/Interpreter.hs)0
-rw-r--r--src/compiler/GF/Command/Messages.hs (renamed from src/GF/Command/Messages.hs)0
-rw-r--r--src/compiler/GF/Command/Parse.hs (renamed from src/GF/Command/Parse.hs)0
-rw-r--r--src/compiler/GF/Command/TreeOperations.hs (renamed from src/GF/Command/TreeOperations.hs)0
-rw-r--r--src/compiler/GF/Compile.hs (renamed from src/GF/Compile.hs)0
-rw-r--r--src/compiler/GF/Compile/Abstract/Compute.hs (renamed from src/GF/Compile/Abstract/Compute.hs)0
-rw-r--r--src/compiler/GF/Compile/Abstract/TC.hs (renamed from src/GF/Compile/Abstract/TC.hs)0
-rw-r--r--src/compiler/GF/Compile/Abstract/TypeCheck.hs (renamed from src/GF/Compile/Abstract/TypeCheck.hs)0
-rw-r--r--src/compiler/GF/Compile/CheckGrammar.hs (renamed from src/GF/Compile/CheckGrammar.hs)0
-rw-r--r--src/compiler/GF/Compile/Coding.hs (renamed from src/GF/Compile/Coding.hs)0
-rw-r--r--src/compiler/GF/Compile/Concrete/AppPredefined.hs (renamed from src/GF/Compile/Concrete/AppPredefined.hs)0
-rw-r--r--src/compiler/GF/Compile/Concrete/Compute.hs (renamed from src/GF/Compile/Concrete/Compute.hs)0
-rw-r--r--src/compiler/GF/Compile/Concrete/TypeCheck.hs (renamed from src/GF/Compile/Concrete/TypeCheck.hs)0
-rw-r--r--src/compiler/GF/Compile/Export.hs (renamed from src/GF/Compile/Export.hs)0
-rw-r--r--src/compiler/GF/Compile/GFCCtoHaskell.hs (renamed from src/GF/Compile/GFCCtoHaskell.hs)0
-rw-r--r--src/compiler/GF/Compile/GFCCtoJS.hs (renamed from src/GF/Compile/GFCCtoJS.hs)0
-rw-r--r--src/compiler/GF/Compile/GFCCtoProlog.hs (renamed from src/GF/Compile/GFCCtoProlog.hs)0
-rw-r--r--src/compiler/GF/Compile/GenerateFCFG.hs (renamed from src/GF/Compile/GenerateFCFG.hs)0
-rw-r--r--src/compiler/GF/Compile/GeneratePMCFG.hs (renamed from src/GF/Compile/GeneratePMCFG.hs)0
-rw-r--r--src/compiler/GF/Compile/GeneratePMCFGOld.hs (renamed from src/GF/Compile/GeneratePMCFGOld.hs)0
-rw-r--r--src/compiler/GF/Compile/GetGrammar.hs (renamed from src/GF/Compile/GetGrammar.hs)0
-rw-r--r--src/compiler/GF/Compile/GrammarToGFCC.hs (renamed from src/GF/Compile/GrammarToGFCC.hs)0
-rw-r--r--src/compiler/GF/Compile/ModDeps.hs (renamed from src/GF/Compile/ModDeps.hs)0
-rw-r--r--src/compiler/GF/Compile/Optimize.hs (renamed from src/GF/Compile/Optimize.hs)0
-rw-r--r--src/compiler/GF/Compile/OptimizeGFCC.hs (renamed from src/GF/Compile/OptimizeGFCC.hs)0
-rw-r--r--src/compiler/GF/Compile/PGFPretty.hs (renamed from src/GF/Compile/PGFPretty.hs)0
-rw-r--r--src/compiler/GF/Compile/ReadFiles.hs (renamed from src/GF/Compile/ReadFiles.hs)0
-rw-r--r--src/compiler/GF/Compile/Refresh.hs (renamed from src/GF/Compile/Refresh.hs)0
-rw-r--r--src/compiler/GF/Compile/Rename.hs (renamed from src/GF/Compile/Rename.hs)0
-rw-r--r--src/compiler/GF/Compile/SubExOpt.hs (renamed from src/GF/Compile/SubExOpt.hs)0
-rw-r--r--src/compiler/GF/Compile/Update.hs (renamed from src/GF/Compile/Update.hs)0
-rw-r--r--src/compiler/GF/Data/Assoc.hs (renamed from src/GF/Data/Assoc.hs)0
-rw-r--r--src/compiler/GF/Data/BacktrackM.hs (renamed from src/GF/Data/BacktrackM.hs)0
-rw-r--r--src/compiler/GF/Data/ErrM.hs (renamed from src/GF/Data/ErrM.hs)0
-rw-r--r--src/compiler/GF/Data/Graph.hs (renamed from src/GF/Data/Graph.hs)0
-rw-r--r--src/compiler/GF/Data/Graphviz.hs (renamed from src/GF/Data/Graphviz.hs)0
-rw-r--r--src/compiler/GF/Data/MultiMap.hs (renamed from src/GF/Data/MultiMap.hs)0
-rw-r--r--src/compiler/GF/Data/Operations.hs (renamed from src/GF/Data/Operations.hs)0
-rw-r--r--src/compiler/GF/Data/Relation.hs (renamed from src/GF/Data/Relation.hs)0
-rw-r--r--src/compiler/GF/Data/SortedList.hs (renamed from src/GF/Data/SortedList.hs)0
-rw-r--r--src/compiler/GF/Data/Str.hs (renamed from src/GF/Data/Str.hs)0
-rw-r--r--src/compiler/GF/Data/TrieMap.hs (renamed from src/GF/Data/TrieMap.hs)0
-rw-r--r--src/compiler/GF/Data/Utilities.hs (renamed from src/GF/Data/Utilities.hs)0
-rw-r--r--src/compiler/GF/Data/XML.hs (renamed from src/GF/Data/XML.hs)0
-rw-r--r--src/compiler/GF/Data/Zipper.hs (renamed from src/GF/Data/Zipper.hs)0
-rw-r--r--src/compiler/GF/Grammar.hs (renamed from src/GF/Grammar.hs)0
-rw-r--r--src/compiler/GF/Grammar/Binary.hs (renamed from src/GF/Grammar/Binary.hs)0
-rw-r--r--src/compiler/GF/Grammar/CF.hs (renamed from src/GF/Grammar/CF.hs)0
-rw-r--r--src/compiler/GF/Grammar/Grammar.hs (renamed from src/GF/Grammar/Grammar.hs)0
-rw-r--r--src/compiler/GF/Grammar/Lexer.hs (renamed from src/GF/Grammar/Lexer.hs)0
-rw-r--r--src/compiler/GF/Grammar/Lexer.x (renamed from src/GF/Grammar/Lexer.x)0
-rw-r--r--src/compiler/GF/Grammar/Lockfield.hs (renamed from src/GF/Grammar/Lockfield.hs)0
-rw-r--r--src/compiler/GF/Grammar/Lookup.hs (renamed from src/GF/Grammar/Lookup.hs)0
-rw-r--r--src/compiler/GF/Grammar/MMacros.hs (renamed from src/GF/Grammar/MMacros.hs)0
-rw-r--r--src/compiler/GF/Grammar/Macros.hs (renamed from src/GF/Grammar/Macros.hs)0
-rw-r--r--src/compiler/GF/Grammar/Parser.y (renamed from src/GF/Grammar/Parser.y)0
-rw-r--r--src/compiler/GF/Grammar/PatternMatch.hs (renamed from src/GF/Grammar/PatternMatch.hs)0
-rw-r--r--src/compiler/GF/Grammar/Predef.hs (renamed from src/GF/Grammar/Predef.hs)0
-rw-r--r--src/compiler/GF/Grammar/Printer.hs (renamed from src/GF/Grammar/Printer.hs)0
-rw-r--r--src/compiler/GF/Grammar/Unify.hs (renamed from src/GF/Grammar/Unify.hs)0
-rw-r--r--src/compiler/GF/Grammar/Values.hs (renamed from src/GF/Grammar/Values.hs)0
-rw-r--r--src/compiler/GF/Infra/CheckM.hs (renamed from src/GF/Infra/CheckM.hs)0
-rw-r--r--src/compiler/GF/Infra/CompactPrint.hs (renamed from src/GF/Infra/CompactPrint.hs)0
-rw-r--r--src/compiler/GF/Infra/Dependencies.hs (renamed from src/GF/Infra/Dependencies.hs)0
-rw-r--r--src/compiler/GF/Infra/GetOpt.hs (renamed from src/GF/Infra/GetOpt.hs)0
-rw-r--r--src/compiler/GF/Infra/Ident.hs (renamed from src/GF/Infra/Ident.hs)0
-rw-r--r--src/compiler/GF/Infra/Modules.hs (renamed from src/GF/Infra/Modules.hs)0
-rw-r--r--src/compiler/GF/Infra/Option.hs (renamed from src/GF/Infra/Option.hs)0
-rw-r--r--src/compiler/GF/Infra/UseIO.hs (renamed from src/GF/Infra/UseIO.hs)0
-rw-r--r--src/compiler/GF/JavaScript/AbsJS.hs (renamed from src/GF/JavaScript/AbsJS.hs)0
-rw-r--r--src/compiler/GF/JavaScript/JS.cf (renamed from src/GF/JavaScript/JS.cf)0
-rw-r--r--src/compiler/GF/JavaScript/LexJS.x (renamed from src/GF/JavaScript/LexJS.x)0
-rw-r--r--src/compiler/GF/JavaScript/Makefile (renamed from src/GF/JavaScript/Makefile)0
-rw-r--r--src/compiler/GF/JavaScript/ParJS.y (renamed from src/GF/JavaScript/ParJS.y)0
-rw-r--r--src/compiler/GF/JavaScript/PrintJS.hs (renamed from src/GF/JavaScript/PrintJS.hs)0
-rw-r--r--src/compiler/GF/Quiz.hs (renamed from src/GF/Quiz.hs)0
-rw-r--r--src/compiler/GF/Speech/CFG.hs (renamed from src/GF/Speech/CFG.hs)0
-rw-r--r--src/compiler/GF/Speech/CFGToFA.hs (renamed from src/GF/Speech/CFGToFA.hs)0
-rw-r--r--src/compiler/GF/Speech/FiniteState.hs (renamed from src/GF/Speech/FiniteState.hs)0
-rw-r--r--src/compiler/GF/Speech/GSL.hs (renamed from src/GF/Speech/GSL.hs)0
-rw-r--r--src/compiler/GF/Speech/JSGF.hs (renamed from src/GF/Speech/JSGF.hs)0
-rw-r--r--src/compiler/GF/Speech/PGFToCFG.hs (renamed from src/GF/Speech/PGFToCFG.hs)0
-rw-r--r--src/compiler/GF/Speech/PrRegExp.hs (renamed from src/GF/Speech/PrRegExp.hs)0
-rw-r--r--src/compiler/GF/Speech/RegExp.hs (renamed from src/GF/Speech/RegExp.hs)0
-rw-r--r--src/compiler/GF/Speech/SISR.hs (renamed from src/GF/Speech/SISR.hs)0
-rw-r--r--src/compiler/GF/Speech/SLF.hs (renamed from src/GF/Speech/SLF.hs)0
-rw-r--r--src/compiler/GF/Speech/SRG.hs (renamed from src/GF/Speech/SRG.hs)0
-rw-r--r--src/compiler/GF/Speech/SRGS_ABNF.hs (renamed from src/GF/Speech/SRGS_ABNF.hs)0
-rw-r--r--src/compiler/GF/Speech/SRGS_XML.hs (renamed from src/GF/Speech/SRGS_XML.hs)0
-rw-r--r--src/compiler/GF/Speech/VoiceXML.hs (renamed from src/GF/Speech/VoiceXML.hs)0
-rw-r--r--src/compiler/GF/System/NoReadline.hs (renamed from src/GF/System/NoReadline.hs)0
-rw-r--r--src/compiler/GF/System/NoSignal.hs (renamed from src/GF/System/NoSignal.hs)0
-rw-r--r--src/compiler/GF/System/Readline.hs (renamed from src/GF/System/Readline.hs)0
-rw-r--r--src/compiler/GF/System/Signal.hs (renamed from src/GF/System/Signal.hs)0
-rw-r--r--src/compiler/GF/System/UseEditline.hs (renamed from src/GF/System/UseEditline.hs)0
-rw-r--r--src/compiler/GF/System/UseHaskeline.hs (renamed from src/GF/System/UseHaskeline.hs)0
-rw-r--r--src/compiler/GF/System/UseReadline.hs (renamed from src/GF/System/UseReadline.hs)0
-rw-r--r--src/compiler/GF/System/UseSignal.hs (renamed from src/GF/System/UseSignal.hs)0
-rw-r--r--src/compiler/GF/Text/CP1250.hs (renamed from src/GF/Text/CP1250.hs)0
-rw-r--r--src/compiler/GF/Text/CP1251.hs (renamed from src/GF/Text/CP1251.hs)0
-rw-r--r--src/compiler/GF/Text/CP1252.hs (renamed from src/GF/Text/CP1252.hs)0
-rw-r--r--src/compiler/GF/Text/Coding.hs (renamed from src/GF/Text/Coding.hs)0
-rw-r--r--src/compiler/GF/Text/Lexing.hs (renamed from src/GF/Text/Lexing.hs)0
-rw-r--r--src/compiler/GF/Text/Transliterations.hs (renamed from src/GF/Text/Transliterations.hs)0
-rw-r--r--src/compiler/GF/Text/UTF8.hs (renamed from src/GF/Text/UTF8.hs)0
-rw-r--r--src/compiler/GFC.hs (renamed from src/GFC.hs)0
-rw-r--r--src/compiler/GFI.hs (renamed from src/GFI.hs)0
-rw-r--r--src/config.guess1497
-rw-r--r--src/config.mk.in37
-rw-r--r--src/config.sub1608
-rw-r--r--src/configure.ac229
-rw-r--r--src/exper/EditShell.hs136
-rw-r--r--src/exper/Evaluate.hs461
-rw-r--r--src/exper/Optimize.hs273
-rw-r--r--src/gf.spec119
-rw-r--r--src/gf.wxs.in63
-rw-r--r--src/gf_atk.cfg98
-rw-r--r--src/gfc.in30
-rw-r--r--src/haddock/haddock-check.perl169
-rw-r--r--src/haddock/haddock-script.csh73
-rw-r--r--src/haddock/resources/blank.html10
-rw-r--r--src/haddock/resources/index.html14
-rw-r--r--src/install-sh251
-rw-r--r--src/runtime/c/Makefile19
-rw-r--r--src/runtime/c/gfcc-term.c203
-rw-r--r--src/runtime/c/gfcc-term.h65
-rw-r--r--src/runtime/c/gfcc-tree.c61
-rw-r--r--src/runtime/c/gfcc-tree.h49
-rw-r--r--src/runtime/haskell/Data/Binary.hs (renamed from src/Data/Binary.hs)0
-rw-r--r--src/runtime/haskell/Data/Binary/Builder.hs (renamed from src/Data/Binary/Builder.hs)0
-rw-r--r--src/runtime/haskell/Data/Binary/Get.hs (renamed from src/Data/Binary/Get.hs)0
-rw-r--r--src/runtime/haskell/Data/Binary/Put.hs (renamed from src/Data/Binary/Put.hs)0
-rw-r--r--src/runtime/haskell/PGF.hs (renamed from src/PGF.hs)0
-rw-r--r--src/runtime/haskell/PGF/Binary.hs (renamed from src/PGF/Binary.hs)0
-rw-r--r--src/runtime/haskell/PGF/BuildParser.hs (renamed from src/PGF/BuildParser.hs)0
-rw-r--r--src/runtime/haskell/PGF/CId.hs (renamed from src/PGF/CId.hs)0
-rw-r--r--src/runtime/haskell/PGF/Check.hs (renamed from src/PGF/Check.hs)0
-rw-r--r--src/runtime/haskell/PGF/Data.hs (renamed from src/PGF/Data.hs)0
-rw-r--r--src/runtime/haskell/PGF/Editor.hs (renamed from src/PGF/Editor.hs)0
-rw-r--r--src/runtime/haskell/PGF/Expr.hs (renamed from src/PGF/Expr.hs)0
-rw-r--r--src/runtime/haskell/PGF/Expr.hs-boot (renamed from src/PGF/Expr.hs-boot)0
-rw-r--r--src/runtime/haskell/PGF/Generate.hs (renamed from src/PGF/Generate.hs)0
-rw-r--r--src/runtime/haskell/PGF/Linearize.hs (renamed from src/PGF/Linearize.hs)0
-rw-r--r--src/runtime/haskell/PGF/Macros.hs (renamed from src/PGF/Macros.hs)0
-rw-r--r--src/runtime/haskell/PGF/Morphology.hs (renamed from src/PGF/Morphology.hs)0
-rw-r--r--src/runtime/haskell/PGF/PMCFG.hs (renamed from src/PGF/PMCFG.hs)0
-rw-r--r--src/runtime/haskell/PGF/Paraphrase.hs (renamed from src/PGF/Paraphrase.hs)0
-rw-r--r--src/runtime/haskell/PGF/Parsing/FCFG/Active.hs (renamed from src/PGF/Parsing/FCFG/Active.hs)0
-rw-r--r--src/runtime/haskell/PGF/Parsing/FCFG/Incremental.hs (renamed from src/PGF/Parsing/FCFG/Incremental.hs)0
-rw-r--r--src/runtime/haskell/PGF/Parsing/FCFG/Utilities.hs (renamed from src/PGF/Parsing/FCFG/Utilities.hs)0
-rw-r--r--src/runtime/haskell/PGF/ShowLinearize.hs (renamed from src/PGF/ShowLinearize.hs)0
-rw-r--r--src/runtime/haskell/PGF/Tree.hs (renamed from src/PGF/Tree.hs)0
-rw-r--r--src/runtime/haskell/PGF/Type.hs (renamed from src/PGF/Type.hs)0
-rw-r--r--src/runtime/haskell/PGF/TypeCheck.hs (renamed from src/PGF/TypeCheck.hs)0
-rw-r--r--src/runtime/haskell/PGF/VisualizeTree.hs (renamed from src/PGF/VisualizeTree.hs)0
-rw-r--r--src/runtime/javascript/editor.html17
-rw-r--r--src/runtime/javascript/editorGrammar.js1
-rw-r--r--src/runtime/javascript/empty.pngbin0 -> 161 bytes
-rw-r--r--src/runtime/javascript/gfjseditor.js1267
-rw-r--r--src/runtime/javascript/gflib-xhtml-voice.js54
-rw-r--r--src/runtime/javascript/gflib.js1128
-rw-r--r--src/runtime/javascript/grammar.js1
-rw-r--r--src/runtime/javascript/minus.pngbin0 -> 201 bytes
-rw-r--r--src/runtime/javascript/plus.pngbin0 -> 229 bytes
-rw-r--r--src/runtime/javascript/style.css241
-rw-r--r--src/runtime/javascript/translator.css54
-rw-r--r--src/runtime/javascript/translator.html48
-rw-r--r--src/runtime/javascript/translator.js51
-rw-r--r--src/server/Makefile59
-rw-r--r--src/server/README132
188 files changed, 3259 insertions, 9140 deletions
diff --git a/src/FILES b/src/FILES
deleted file mode 100644
index 1311108b6..000000000
--- a/src/FILES
+++ /dev/null
@@ -1,260 +0,0 @@
-
-Code map for GF source files.
-
-$Author: peb $
-$Date: 2005/02/07 10:58:08 $
-
-Directories:
-
-[top level] GF main function and runtime-related modules
-api high-level access to GF functionalities
-canonical GFC (= GF Canonical) basic functionalities
-cf context-free skeleton used in parsing
-cfgm multilingual context-free skeleton exported to Java
-compile compilation phases from GF to GFC
-conversions [OBSOLETE] formats used in parser generation
-for-ghc GHC-specific files (Glasgow Haskell Compiler)
-for-hugs Hugs-specific files (a Haskell interpreter)
-for-windows Windows-specific files (an operating system from Microsoft)
-grammar basic functionalities of GF grammars used in compilation
-infra GF-independent infrastructure and auxiliaries
-newparsing parsing with GF grammars: current version (cf. parsing)
-notrace debugging utilities for parser development (cf. trace)
-parsers parsers of GF and GFC files
-parsing [OBSOLETE] parsing with GF grammars: old version (cf. newparsing)
-shell interaction shells
-source utilities for reading in GF source files
-speech generation of speech recognition grammars
-trace debugging utilities for parser development (cf. notrace)
-useGrammar grammar functionalities for applications
-util utilities for using GF
-
-
-Individual files:
-
-GF.hs the Main module
-GFModes.hs
-HelpFile.hs [AUTO] help file generated by util/MkHelpFile
-Today.hs [AUTO] file generated by "make today"
-
-api/API.hs high-level access to GF functionalities
-api/BatchTranslate.hs
-api/GetMyTree.hs
-api/GrammarToHaskell.hs
-api/IOGrammar.hs
-api/MyParser.hs slot for defining your own parser
-
-canonical/AbsGFC.hs [AUTO] abstract syntax of GFC
-canonical/CanonToGrammar.hs
-canonical/CMacros.hs
-canonical/ErrM.hs
-canonical/GetGFC.hs
-canonical/GFC.cf [LBNF] source of GFC parser
-canonical/GFC.hs
-canonical/LexGFC.hs
-canonical/Look.hs
-canonical/MkGFC.hs
-canonical/PrExp.hs
-canonical/PrintGFC.hs pretty-printer of GFC
-canonical/Share.hs
-canonical/SkelGFC.hs [AUTO]
-canonical/TestGFC.hs [AUTO]
-canonical/Unlex.hs
-
-cf/CanonToCF.hs
-cf/CF.hs abstract syntax of context-free grammars
-cf/CFIdent.hs
-cf/CFtoGrammar.hs
-cf/CFtoSRG.hs
-cf/ChartParser.hs the current default parsing method
-cf/EBNF.hs
-cf/PPrCF.hs
-cf/PrLBNF.hs
-cf/Profile.hs
-
-cfgm/CFG.cf [LBNF] source
-cfgm/AbsCFG.hs [AUTO]
-cfgm/LexCFG.hs [AUTO]
-cfgm/ParCFG.hs [AUTO]
-cfgm/PrintCFG.hs [AUTO]
-cfgm/PrintCFGrammar.hs
-
-compile/CheckGrammar.hs
-compile/Compile.hs the complete compiler pipeline
-compile/Extend.hs
-compile/GetGrammar.hs
-compile/GrammarToCanon.hs
-compile/MkResource.hs
-compile/MkUnion.hs
-compile/ModDeps.hs
-compile/Optimize.hs
-compile/PGrammar.hs
-compile/PrOld.hs
-compile/Rebuild.hs
-compile/RemoveLiT.hs
-compile/Rename.hs
-compile/ShellState.hs the run-time multilingual grammar datastructure
-compile/Update.hs
-
-for-ghc/ArchEdit.hs
-for-ghc/Arch.hs
-
-for-ghc-nofud/ArchEdit.hs@
-for-ghc-nofud/Arch.hs@
-
-for-hugs/ArchEdit.hs
-for-hugs/Arch.hs
-for-hugs/JGF.hs
-for-hugs/MoreCustom.hs
-for-hugs/Unicode.hs
-
-for-hugs/Arch.hs
-for-hugs/ArchEdit.hs
-for-hugs/JGF.hs
-for-hugs/LexCFG.hs dummy CFG lexer
-for-hugs/LexGF.hs dummy GF lexer
-for-hugs/LexGFC.hs dummy GFC lexer
-for-hugs/MoreCustom.hs
-for-hugs/ParCFG.hs dummy CFG parser
-for-hugs/ParGFC.hs dummy GFC parser
-for-hugs/ParGF.hs dummy GF parser
-for-hugs/Tracing.hs
-for-hugs/Unicode.hs
-
-for-windows/ArchEdit.hs
-for-windows/Arch.hs
-
-grammar/AbsCompute.hs
-grammar/Abstract.hs GF and GFC abstract syntax datatypes
-grammar/AppPredefined.hs
-grammar/Compute.hs
-grammar/Grammar.hs GF source grammar datatypes
-grammar/LookAbs.hs
-grammar/Lookup.hs
-grammar/Macros.hs macros for creating GF terms and types
-grammar/MMacros.hs more macros, mainly for abstract syntax
-grammar/PatternMatch.hs
-grammar/PrGrammar.hs the top-level grammar printer
-grammar/Refresh.hs
-grammar/ReservedWords.hs
-grammar/TC.hs Coquand's type checking engine
-grammar/TypeCheck.hs
-grammar/Unify.hs
-grammar/Values.hs
-
-infra/Arabic.hs ASCII coding of Arabic Unicode
-infra/Assoc.hs finite maps/association lists as binary search trees
-infra/CheckM.hs
-infra/Comments.hs
-infra/Devanagari.hs ASCII coding of Devanagari Unicode
-infra/ErrM.hs
-infra/Ethiopic.hs
-infra/EventF.hs
-infra/ExtendedArabic.hs
-infra/ExtraDiacritics.hs
-infra/FudgetOps.hs
-infra/Glue.hs
-infra/Greek.hs
-infra/Hebrew.hs
-infra/Hiragana.hs
-infra/Ident.hs
-infra/LatinASupplement.hs
-infra/Map.hs finite maps as red black trees
-infra/Modules.hs
-infra/OCSCyrillic.hs
-infra/Operations.hs library of strings, search trees, error monads
-infra/Option.hs
-infra/OrdMap2.hs abstract class of finite maps + implementation as association lists
-infra/OrdSet.hs abstract class of sets + implementation as sorted lists
-infra/Parsers.hs
-infra/ReadFiles.hs
-infra/RedBlack.hs red black trees
-infra/RedBlackSet.hs sets and maps as red black trees
-infra/Russian.hs
-infra/SortedList.hs sets as sorted lists
-infra/Str.hs
-infra/Tamil.hs
-infra/Text.hs
-infra/Trie2.hs
-infra/Trie.hs
-infra/UnicodeF.hs
-infra/Unicode.hs
-infra/UseIO.hs
-infra/UTF8.hs UTF3 en/decoding
-infra/Zipper.hs
-
-newparsing/CFGrammar.hs type definitions for context-free grammars
-newparsing/CFParserGeneral.hs several variants of general CFG chart parsing
-newparsing/CFParserIncremental.hs several variants of incremental (Earley-style) CFG chart parsing
-newparsing/ConvertGFCtoMCFG.hs converting GFC to MCFG
-newparsing/ConvertGrammar.hs conversions between different grammar formats
-newparsing/ConvertMCFGtoCFG.hs converting MCFG to CFG
-newparsing/GeneralChart.hs Haskell framework for "parsing as deduction"
-newparsing/GrammarTypes.hs instantiations of grammar types
-newparsing/IncrementalChart.hs Haskell framework for incremental chart parsing
-newparsing/MCFGrammar.hs type definitions for multiple CFG
-newparsing/MCFParserBasic.hs MCFG chart parser
-newparsing/MCFRange.hs ranges for MCFG parsing
-newparsing/ParseCFG.hs parsing of CFG
-newparsing/ParseCF.hs parsing of the CF format
-newparsing/ParseGFC.hs parsing of GFC
-newparsing/ParseMCFG.hs parsing of MCFG
-newparsing/Parser.hs general definitions for parsers
-newparsing/PrintParser.hs pretty-printing class for parsers
-newparsing/PrintSimplifiedTerm.hs simplified pretty-printing for GFC terms
-
-notrace/Tracing.hs tracing predicates when we DON'T want tracing capabilities (normal case)
-
-parsers/ParGFC.hs [AUTO]
-parsers/ParGF.hs [AUTO]
-
-shell/CommandF.hs
-shell/CommandL.hs line-based syntax of editor commands
-shell/Commands.hs commands of GF editor shell
-shell/IDE.hs
-shell/JGF.hs
-shell/PShell.hs
-shell/ShellCommands.hs commands of GF main shell
-shell/Shell.hs
-shell/SubShell.hs
-shell/TeachYourself.hs
-
-source/AbsGF.hs [AUTO]
-source/ErrM.hs
-source/GF.cf [LBNF] source of GF parser
-source/GrammarToSource.hs
-source/LexGF.hs [AUTO]
-source/PrintGF.hs [AUTO]
-source/SourceToGrammar.hs
-
-speech/PrGSL.hs
-speech/PrJSGF.hs
-speech/SRG.hs
-speech/TransformCFG.hs
-
-trace/Tracing.hs tracing predicates when we want tracing capabilities
-
-translate/GFT.hs Main module of html-producing batch translator
-
-useGrammar/Custom.hs database for customizable commands
-useGrammar/Editing.hs
-useGrammar/Generate.hs
-useGrammar/GetTree.hs
-useGrammar/Information.hs
-useGrammar/Linear.hs the linearization algorithm
-useGrammar/MoreCustom.hs
-useGrammar/Morphology.hs
-useGrammar/Paraphrases.hs
-useGrammar/Parsing.hs the top-level parsing algorithm
-useGrammar/Randomized.hs
-useGrammar/RealMoreCustom.hs
-useGrammar/Session.hs
-useGrammar/TeachYourself.hs
-useGrammar/Tokenize.hs lexer definitions (listed in Custom)
-useGrammar/Transfer.hs
-
-util/GFDoc.hs utility for producing LaTeX and HTML from GF
-util/HelpFile source of ../HelpFile.hs
-util/Htmls.hs utility for chopping a HTML document to slides
-util/MkHelpFile.hs
-util/WriteF.hs
diff --git a/src/HelpFile b/src/HelpFile
deleted file mode 100644
index c6b38b313..000000000
--- a/src/HelpFile
+++ /dev/null
@@ -1,693 +0,0 @@
--- GF help file updated for GF 2.6, 17/6/2006.
--- *: Commands and options marked with * are currently not implemented.
---
--- Each command has a long and a short name, options, and zero or more
--- arguments. Commands are sorted by functionality. The short name is
--- given first.
-
--- Type "h -all" for full help file, "h <CommandName>" for full help on a command.
-
--- commands that change the state
-
-i, import: i File
- Reads a grammar from File and compiles it into a GF runtime grammar.
- Files "include"d in File are read recursively, nubbing repetitions.
- If a grammar with the same language name is already in the state,
- it is overwritten - but only if compilation succeeds.
- The grammar parser depends on the file name suffix:
- .gf normal GF source
- .gfc canonical GF
- .gfr precompiled GF resource
- .gfcm multilingual canonical GF
- .gfe example-based grammar files (only with the -ex option)
- .gfwl multilingual word list (preprocessed to abs + cncs)
- .ebnf Extended BNF format
- .cf Context-free (BNF) format
- .trc TransferCore format
- options:
- -old old: parse in GF<2.0 format (not necessary)
- -v verbose: give lots of messages
- -s silent: don't give error messages
- -src from source: ignore precompiled gfc and gfr files
- -gfc from gfc: use compiled modules whenever they exist
- -retain retain operations: read resource modules (needed in comm cc)
- -nocf don't build old-style context-free grammar (default without HOAS)
- -docf do build old-style context-free grammar (default with HOAS)
- -nocheckcirc don't eliminate circular rules from CF
- -cflexer build an optimized parser with separate lexer trie
- -noemit do not emit code (default with old grammar format)
- -o do emit code (default with new grammar format)
- -ex preprocess .gfe files if needed
- -prob read probabilities from top grammar file (format --# prob Fun Double)
- -treebank read a treebank file to memory (xml format)
- flags:
- -abs set the name used for abstract syntax (with -old option)
- -cnc set the name used for concrete syntax (with -old option)
- -res set the name used for resource (with -old option)
- -path use the (colon-separated) search path to find modules
- -optimize select an optimization to override file-defined flags
- -conversion select parsing method (values strict|nondet)
- -probs read probabilities from file (format (--# prob) Fun Double)
- -preproc use a preprocessor on each source file
- -noparse read nonparsable functions from file (format --# noparse Funs)
- examples:
- i English.gf -- ordinary import of Concrete
- i -retain german/ParadigmsGer.gf -- import of Resource to test
-
-r, reload: r
- Executes the previous import (i) command.
-
-rl, remove_language: rl Language
- Takes away the language from the state.
-
-e, empty: e
- Takes away all languages and resets all global flags.
-
-sf, set_flags: sf Flag*
- The values of the Flags are set for Language. If no language
- is specified, the flags are set globally.
- examples:
- sf -nocpu -- stop showing CPU time
- sf -lang=Swe -- make Swe the default concrete
-
-s, strip: s
- Prune the state by removing source and resource modules.
-
-dc, define_command Name Anything
- Add a new defined command. The Name must star with '%'. Later,
- if 'Name X' is used, it is replaced by Anything where #1 is replaced
- by X.
- Restrictions: Currently at most one argument is possible, and a defined
- command cannot appear in a pipe.
- To see what definitions are in scope, use help -defs.
- examples:
- dc %tnp p -cat=NP -lang=Eng #1 | l -lang=Swe -- translate NPs
- %tnp "this man" -- translate and parse
-
-dt, define_term Name Tree
- Add a constant for a tree. The constant can later be called by
- prefixing it with '$'.
- Restriction: These terms are not yet usable as a subterm.
- To see what definitions are in scope, use help -defs.
- examples:
- p -cat=NP "this man" | dt tm -- define tm as parse result
- l -all $tm -- linearize tm in all forms
-
--- commands that give information about the state
-
-pg, print_grammar: pg
- Prints the actual grammar (overridden by the -lang=X flag).
- The -printer=X flag sets the format in which the grammar is
- written.
- N.B. since grammars are compiled when imported, this command
- generally does not show the grammar in the same format as the
- source. In particular, the -printer=latex is not supported.
- Use the command tg -printer=latex File to print the source
- grammar in LaTeX.
- options:
- -utf8 apply UTF8-encoding to the grammar
- flags:
- -printer
- -lang
- -startcat -- The start category of the generated grammar.
- Only supported by some grammar printers.
- examples:
- pg -printer=cf -- show the context-free skeleton
-
-pm, print_multigrammar: pm
- Prints the current multilingual grammar in .gfcm form.
- (Automatically executes the strip command (s) before doing this.)
- options:
- -utf8 apply UTF8 encoding to the tokens in the grammar
- -utf8id apply UTF8 encoding to the identifiers in the grammar
- examples:
- pm | wf Letter.gfcm -- print the grammar into the file Letter.gfcm
- pm -printer=graph | wf D.dot -- then do 'dot -Tps D.dot > D.ps'
-
-vg, visualize_graph: vg
- Show the dependency graph of multilingual grammar via dot and gv.
-
-po, print_options: po
- Print what modules there are in the state. Also
- prints those flag values in the current state that differ from defaults.
-
-pl, print_languages: pl
- Prints the names of currently available languages.
-
-pi, print_info: pi Ident
- Prints information on the identifier.
-
--- commands that execute and show the session history
-
-eh, execute_history: eh File
- Executes commands in the file.
-
-ph, print_history; ph
- Prints the commands issued during the GF session.
- The result is readable by the eh command.
- examples:
- ph | wf foo.hist" -- save the history into a file
-
--- linearization, parsing, translation, and computation
-
-l, linearize: l PattList? Tree
- Shows all linearization forms of Tree by the actual grammar
- (which is overridden by the -lang flag).
- The pattern list has the form [P, ... ,Q] where P,...,Q follow GF
- syntax for patterns. All those forms are generated that match with the
- pattern list. Too short lists are filled with variables in the end.
- Only the -table flag is available if a pattern list is specified.
- HINT: see GF language specification for the syntax of Pattern and Term.
- You can also copy and past parsing results.
- options:
- -struct bracketed form
- -table show parameters (not compatible with -record, -all)
- -record record, i.e. explicit GF concrete syntax term (not compatible with -table, -all)
- -all show all forms and variants (not compatible with -record, -table)
- -multi linearize to all languages (can be combined with the other options)
- flags:
- -lang linearize in this grammar
- -number give this number of forms at most
- -unlexer filter output through unlexer
- examples:
- l -lang=Swe -table -- show full inflection table in Swe
-
-p, parse: p String
- Shows all Trees returned for String by the actual
- grammar (overridden by the -lang flag), in the category S (overridden
- by the -cat flag).
- options for batch input:
- -lines parse each line of input separately, ignoring empty lines
- -all as -lines, but also parse empty lines
- -prob rank results by probability
- -cut stop after first lexing result leading to parser success
- -fail show strings whose parse fails prefixed by #FAIL
- -ambiguous show strings that have more than one parse prefixed by #AMBIGUOUS
- options for selecting parsing method:
- -fcfg parse using a fast variant of MCFG (default is no HOAS in grammar)
- -old parse using an overgenerating CFG (default if HOAS in grammar)
- -cfg parse using a much less overgenerating CFG
- -mcfg parse using an even less overgenerating MCFG
- Note: the first time parsing with -cfg, -mcfg, and -fcfg may take a long time
- options that only work for the -old default parsing method:
- -n non-strict: tolerates morphological errors
- -ign ignore unknown words when parsing
- -raw return context-free terms in raw form
- -v verbose: give more information if parsing fails
- flags:
- -cat parse in this category
- -lang parse in this grammar
- -lexer filter input through this lexer
- -parser use this parsing strategy
- -number return this many results at most
- examples:
- p -cat=S -mcfg "jag är gammal" -- parse an S with the MCFG
- rf examples.txt | p -lines -- parse each non-empty line of the file
-
-at, apply_transfer: at (Module.Fun | Fun)
- Transfer a term using Fun from Module, or the topmost transfer
- module. Transfer modules are given in the .trc format. They are
- shown by the 'po' command.
- flags:
- -lang typecheck the result in this lang instead of default lang
- examples:
- p -lang=Cncdecimal "123" | at num2bin | l -- convert dec to bin
-
-tb, tree_bank: tb
- Generate a multilingual treebank from a list of trees (default) or compare
- to an existing treebank.
- options:
- -c compare to existing xml-formatted treebank
- -trees return the trees of the treebank
- -all show all linearization alternatives (branches and variants)
- -table show tables of linearizations with parameters
- -record show linearization records
- -xml wrap the treebank (or comparison results) with XML tags
- -mem write the treebank in memory instead of a file TODO
- examples:
- gr -cat=S -number=100 | tb -xml | wf tb.xml -- random treebank into file
- rf tb.xml | tb -c -- compare-test treebank from file
- rf old.xml | tb -trees | tb -xml -- create new treebank from old
-
-ut, use_treebank: ut String
- Lookup a string in a treebank and return the resulting trees.
- Use 'tb' to create a treebank and 'i -treebank' to read one from
- a file.
- options:
- -assocs show all string-trees associations in the treebank
- -strings show all strings in the treebank
- -trees show all trees in the treebank
- -raw return the lookup result as string, without typechecking it
- flags:
- -treebank use this treebank (instead of the latest introduced one)
- examples:
- ut "He adds this to that" | l -multi -- use treebank lookup as parser in translation
- ut -assocs | grep "ComplV2" -- show all associations with ComplV2
-
-tt, test_tokenizer: tt String
- Show the token list sent to the parser when String is parsed.
- HINT: can be useful when debugging the parser.
- flags:
- -lexer use this lexer
- examples:
- tt -lexer=codelit "2*(x + 3)" -- a favourite lexer for program code
-
-g, grep: g String1 String2
- Grep the String1 in the String2. String2 is read line by line,
- and only those lines that contain String1 are returned.
- flags:
- -v return those lines that do not contain String1.
- examples:
- pg -printer=cf | grep "mother" -- show cf rules with word mother
-
-cc, compute_concrete: cc Term
- Compute a term by concrete syntax definitions. Uses the topmost
- resource module (the last in listing by command po) to resolve
- constant names.
- N.B. You need the flag -retain when importing the grammar, if you want
- the oper definitions to be retained after compilation; otherwise this
- command does not expand oper constants.
- N.B.' The resulting Term is not a term in the sense of abstract syntax,
- and hence not a valid input to a Tree-demanding command.
- flags:
- -table show output in a similar readable format as 'l -table'
- -res use another module than the topmost one
- examples:
- cc -res=ParadigmsFin (nLukko "hyppy") -- inflect "hyppy" with nLukko
-
-so, show_operations: so Type
- Show oper operations with the given value type. Uses the topmost
- resource module to resolve constant names.
- N.B. You need the flag -retain when importing the grammar, if you want
- the oper definitions to be retained after compilation; otherwise this
- command does not find any oper constants.
- N.B.' The value type may not be defined in a supermodule of the
- topmost resource. In that case, use appropriate qualified name.
- flags:
- -res use another module than the topmost one
- examples:
- so -res=ParadigmsFin ResourceFin.N -- show N-paradigms in ParadigmsFin
-
-t, translate: t Lang Lang String
- Parses String in Lang1 and linearizes the resulting Trees in Lang2.
- flags:
- -cat
- -lexer
- -parser
- examples:
- t Eng Swe -cat=S "every number is even or odd"
-
-gr, generate_random: gr Tree?
- Generates a random Tree of a given category. If a Tree
- argument is given, the command completes the Tree with values to
- the metavariables in the tree.
- options:
- -prob use probabilities (works for nondep types only)
- -cf use a very fast method (works for nondep types only)
- flags:
- -cat generate in this category
- -lang use the abstract syntax of this grammar
- -number generate this number of trees (not impl. with Tree argument)
- -depth use this number of search steps at most
- examples:
- gr -cat=Query -- generate in category Query
- gr (PredVP ? (NegVG ?)) -- generate a random tree of this form
- gr -cat=S -tr | l -- gererate and linearize
-
-gt, generate_trees: gt Tree?
- Generates all trees up to a given depth. If the depth is large,
- a small -alts is recommended. If a Tree argument is given, the
- command completes the Tree with values to the metavariables in
- the tree.
- options:
- -metas also return trees that include metavariables
- -all generate all (can be infinitely many, lazily)
- -lin linearize result of -all (otherwise, use pipe to linearize)
- flags:
- -depth generate to this depth (default 3)
- -atoms take this number of atomic rules of each category (default unlimited)
- -alts take this number of alternatives at each branch (default unlimited)
- -cat generate in this category
- -nonub don't remove duplicates (faster, not effective with -mem)
- -mem use a memorizing algorithm (often faster, usually more memory-consuming)
- -lang use the abstract syntax of this grammar
- -number generate (at most) this number of trees (also works with -all)
- -noexpand don't expand these categories (comma-separated, e.g. -noexpand=V,CN)
- -doexpand only expand these categories (comma-separated, e.g. -doexpand=V,CN)
- examples:
- gt -depth=10 -cat=NP -- generate all NP's to depth 10
- gt (PredVP ? (NegVG ?)) -- generate all trees of this form
- gt -cat=S -tr | l -- generate and linearize
- gt -noexpand=NP | l -mark=metacat -- the only NP is meta, linearized "?0 +NP"
- gt | l | p -lines -ambiguous | grep "#AMBIGUOUS" -- show ambiguous strings
-
-ma, morphologically_analyse: ma String
- Runs morphological analysis on each word in String and displays
- the results line by line.
- options:
- -short show analyses in bracketed words, instead of separate lines
- -status show just the work at success, prefixed with "*" at failure
- flags:
- -lang
- examples:
- wf Bible.txt | ma -short | wf Bible.tagged -- analyse the Bible
-
-
--- elementary generation of Strings and Trees
-
-ps, put_string: ps String
- Returns its argument String, like Unix echo.
- HINT. The strength of ps comes from the possibility to receive the
- argument from a pipeline, and altering it by the -filter flag.
- flags:
- -filter filter the result through this string processor
- -length cut the string after this number of characters
- examples:
- gr -cat=Letter | l | ps -filter=text -- random letter as text
-
-pt, put_tree: pt Tree
- Returns its argument Tree, like a specialized Unix echo.
- HINT. The strength of pt comes from the possibility to receive
- the argument from a pipeline, and altering it by the -transform flag.
- flags:
- -transform transform the result by this term processor
- -number generate this number of terms at most
- examples:
- p "zero is even" | pt -transform=solve -- solve ?'s in parse result
-
-* st, show_tree: st Tree
- Prints the tree as a string. Unlike pt, this command cannot be
- used in a pipe to produce a tree, since its output is a string.
- flags:
- -printer show the tree in a special format (-printer=xml supported)
-
-wt, wrap_tree: wt Fun
- Wraps the tree as the sole argument of Fun.
- flags:
- -c compute the resulting new tree to normal form
-
-vt, visualize_tree: vt Tree
- Shows the abstract syntax tree via dot and gv (via temporary files
- grphtmp.dot, grphtmp.ps).
- flags:
- -c show categories only (no functions)
- -f show functions only (no categories)
- -g show as graph (sharing uses of the same function)
- -o just generate the .dot file
- examples:
- p "hello world" | vt -o | wf my.dot ;; ! open -a GraphViz my.dot
- -- This writes the parse tree into my.dot and opens the .dot file
- -- with another application without generating .ps.
-
--- subshells
-
-es, editing_session: es
- Opens an interactive editing session.
- N.B. Exit from a Fudget session is to the Unix shell, not to GF.
- options:
- -f Fudget GUI (necessary for Unicode; only available in X Window System)
-
-ts, translation_session: ts
- Translates input lines from any of the actual languages to all other ones.
- To exit, type a full stop (.) alone on a line.
- N.B. Exit from a Fudget session is to the Unix shell, not to GF.
- HINT: Set -parser and -lexer locally in each grammar.
- options:
- -f Fudget GUI (necessary for Unicode; only available in X Windows)
- -lang prepend translation results with language names
- flags:
- -cat the parser category
- examples:
- ts -cat=Numeral -lang -- translate numerals, show language names
-
-tq, translation_quiz: tq Lang Lang
- Random-generates translation exercises from Lang1 to Lang2,
- keeping score of success.
- To interrupt, type a full stop (.) alone on a line.
- HINT: Set -parser and -lexer locally in each grammar.
- flags:
- -cat
- examples:
- tq -cat=NP TestResourceEng TestResourceSwe -- quiz for NPs
-
-tl, translation_list: tl Lang Lang
- Random-generates a list of ten translation exercises from Lang1
- to Lang2. The number can be changed by a flag.
- HINT: use wf to save the exercises in a file.
- flags:
- -cat
- -number
- examples:
- tl -cat=NP TestResourceEng TestResourceSwe -- quiz list for NPs
-
-mq, morphology_quiz: mq
- Random-generates morphological exercises,
- keeping score of success.
- To interrupt, type a full stop (.) alone on a line.
- HINT: use printname judgements in your grammar to
- produce nice expressions for desired forms.
- flags:
- -cat
- -lang
- examples:
- mq -cat=N -lang=TestResourceSwe -- quiz for Swedish nouns
-
-ml, morphology_list: ml
- Random-generates a list of ten morphological exercises,
- keeping score of success. The number can be changed with a flag.
- HINT: use wf to save the exercises in a file.
- flags:
- -cat
- -lang
- -number
- examples:
- ml -cat=N -lang=TestResourceSwe -- quiz list for Swedish nouns
-
-
--- IO related commands
-
-rf, read_file: rf File
- Returns the contents of File as a String; error if File does not exist.
-
-wf, write_file: wf File String
- Writes String into File; File is created if it does not exist.
- N.B. the command overwrites File without a warning.
-
-af, append_file: af File
- Writes String into the end of File; File is created if it does not exist.
-
-* tg, transform_grammar: tg File
- Reads File, parses as a grammar,
- but instead of compiling further, prints it.
- The environment is not changed. When parsing the grammar, the same file
- name suffixes are supported as in the i command.
- HINT: use this command to print the grammar in
- another format (the -printer flag); pipe it to wf to save this format.
- flags:
- -printer (only -printer=latex supported currently)
-
-* cl, convert_latex: cl File
- Reads File, which is expected to be in LaTeX form.
- Three environments are treated in special ways:
- \begGF - \end{verbatim}, which contains GF judgements,
- \begTGF - \end{verbatim}, which contains a GF expression (displayed)
- \begInTGF - \end{verbatim}, which contains a GF expressions (inlined).
- Moreover, certain macros should be included in the file; you can
- get those macros by applying 'tg -printer=latex foo.gf' to any grammar
- foo.gf. Notice that the same File can be imported as a GF grammar,
- consisting of all the judgements in \begGF environments.
- HINT: pipe with 'wf Foo.tex' to generate a new Latex file.
-
-sa, speak_aloud: sa String
- Uses the Flite speech generator to produce speech for String.
- Works for American English spelling.
- examples:
- h | sa -- listen to the list of commands
- gr -cat=S | l | sa -- generate a random sentence and speak it aloud
-
-si, speech_input: si
- Uses an ATK speech recognizer to get speech input.
- flags:
- -lang: The grammar to use with the speech recognizer.
- -cat: The grammar category to get input in.
- -language: Use acoustic model and dictionary for this language.
- -number: The number of utterances to recognize.
-
-h, help: h Command?
- Displays the paragraph concerning the command from this help file.
- Without the argument, shows the first lines of all paragraphs.
- options
- -all show the whole help file
- -defs show user-defined commands and terms
- -FLAG show the values of FLAG (works for grammar-independent flags)
- examples:
- h print_grammar -- show all information on the pg command
-
-q, quit: q
- Exits GF.
- HINT: you can use 'ph | wf history' to save your session.
-
-!, system_command: ! String
- Issues a system command. No value is returned to GF.
- example:
- ! ls
-
-?, system_command: ? String
- Issues a system command that receives its arguments from GF pipe
- and returns a value to GF.
- example:
- h | ? 'wc -l' | p -cat=Num
-
-
--- Flags. The availability of flags is defined separately for each command.
-
--cat, category in which parsing is performed.
- The default is S.
-
--depth, the search depth in e.g. random generation.
- The default depends on application.
-
--filter, operation performed on a string. The default is identity.
- -filter=identity no change
- -filter=erase erase the text
- -filter=take100 show the first 100 characters
- -filter=length show the length of the string
- -filter=text format as text (punctuation, capitalization)
- -filter=code format as code (spacing, indentation)
-
--lang, grammar used when executing a grammar-dependent command.
- The default is the last-imported grammar.
-
--language, voice used by Festival as its --language flag in the sa command.
- The default is system-dependent.
-
--length, the maximum number of characters shown of a string.
- The default is unlimited.
-
--lexer, tokenization transforming a string into lexical units for a parser.
- The default is words.
- -lexer=words tokens are separated by spaces or newlines
- -lexer=literals like words, but GF integer and string literals recognized
- -lexer=vars like words, but "x","x_...","$...$" as vars, "?..." as meta
- -lexer=chars each character is a token
- -lexer=code use Haskell's lex
- -lexer=codevars like code, but treat unknown words as variables, ?? as meta
- -lexer=textvars like text, but treat unknown words as variables, ?? as meta
- -lexer=text with conventions on punctuation and capital letters
- -lexer=codelit like code, but treat unknown words as string literals
- -lexer=textlit like text, but treat unknown words as string literals
- -lexer=codeC use a C-like lexer
- -lexer=ignore like literals, but ignore unknown words
- -lexer=subseqs like ignore, but then try all subsequences from longest
-
--number, the maximum number of generated items in a list.
- The default is unlimited.
-
--optimize, optimization on generated code.
- The default is share for concrete, none for resource modules.
- Each of the flags can have the suffix _subs, which performs
- common subexpression elimination after the main optimization.
- Thus, -optimize=all_subs is the most aggressive one. The _subs
- strategy only works in GFC, and applies therefore in concrete but
- not in resource modules.
- -optimize=share share common branches in tables
- -optimize=parametrize first try parametrize then do share with the rest
- -optimize=values represent tables as courses-of-values
- -optimize=all first try parametrize then do values with the rest
- -optimize=none no optimization
-
--parser, parsing strategy. The default is chart. If -cfg or -mcfg are
- selected, only bottomup and topdown are recognized.
- -parser=chart bottom-up chart parsing
- -parser=bottomup a more up to date bottom-up strategy
- -parser=topdown top-down strategy
- -parser=old an old bottom-up chart parser
-
--printer, format in which the grammar is printed. The default is
- gfc. Those marked with M are (only) available for pm, the rest
- for pg.
- -printer=gfc GFC grammar
- -printer=gf GF grammar
- -printer=old old GF grammar
- -printer=cf context-free grammar, with profiles
- -printer=bnf context-free grammar, without profiles
- -printer=lbnf labelled context-free grammar for BNF Converter
- -printer=plbnf grammar for BNF Converter, with precedence levels
- *-printer=happy source file for Happy parser generator (use lbnf!)
- -printer=haskell abstract syntax in Haskell, with transl to/from GF
- -printer=haskell_gadt abstract syntax GADT in Haskell, with transl to/from GF
- -printer=morpho full-form lexicon, long format
- *-printer=latex LaTeX file (for the tg command)
- -printer=fullform full-form lexicon, short format
- *-printer=xml XML: DTD for the pg command, object for st
- -printer=old old GF: file readable by GF 1.2
- -printer=stat show some statistics of generated GFC
- -printer=probs show probabilities of all functions
- -printer=gsl Nuance GSL speech recognition grammar
- -printer=jsgf Java Speech Grammar Format
- -printer=jsgf_sisr_old Java Speech Grammar Format with semantic tags in
- SISR WD 20030401 format
- -printer=srgs_abnf SRGS ABNF format
- -printer=srgs_abnf_non_rec SRGS ABNF format, without any recursion.
- -printer=srgs_abnf_sisr_old SRGS ABNF format, with semantic tags in
- SISR WD 20030401 format
- -printer=srgs_xml SRGS XML format
- -printer=srgs_xml_non_rec SRGS XML format, without any recursion.
- -printer=srgs_xml_prob SRGS XML format, with weights
- -printer=srgs_xml_sisr_old SRGS XML format, with semantic tags in
- SISR WD 20030401 format
- -printer=vxml Generate a dialogue system in VoiceXML.
- -printer=slf a finite automaton in the HTK SLF format
- -printer=slf_graphviz the same automaton as slf, but in Graphviz format
- -printer=slf_sub a finite automaton with sub-automata in the
- HTK SLF format
- -printer=slf_sub_graphviz the same automaton as slf_sub, but in
- Graphviz format
- -printer=fa_graphviz a finite automaton with labelled edges
- -printer=regular a regular grammar in a simple BNF
- -printer=unpar a gfc grammar with parameters eliminated
- -printer=functiongraph abstract syntax functions in 'dot' format
- -printer=typegraph abstract syntax categories in 'dot' format
- -printer=transfer Transfer language datatype (.tr file format)
- -printer=cfg-prolog M cfg in prolog format (also pg)
- -printer=gfc-prolog M gfc in prolog format (also pg)
- -printer=gfcm M gfcm file (default for pm)
- -printer=graph M module dependency graph in 'dot' (graphviz) format
- -printer=header M gfcm file with header (for GF embedded in Java)
- -printer=js M JavaScript type annotator and linearizer
- -printer=mcfg-prolog M mcfg in prolog format (also pg)
- -printer=missing M the missing linearizations of each concrete
-
--startcat, like -cat, but used in grammars (to avoid clash with keyword cat)
-
--transform, transformation performed on a syntax tree. The default is identity.
- -transform=identity no change
- -transform=compute compute by using definitions in the grammar
- -transform=nodup return the term only if it has no constants duplicated
- -transform=nodupatom return the term only if it has no atomic constants duplicated
- -transform=typecheck return the term only if it is type-correct
- -transform=solve solve metavariables as derived refinements
- -transform=context solve metavariables by unique refinements as variables
- -transform=delete replace the term by metavariable
-
--unlexer, untokenization transforming linearization output into a string.
- The default is unwords.
- -unlexer=unwords space-separated token list (like unwords)
- -unlexer=text format as text: punctuation, capitals, paragraph <p>
- -unlexer=code format as code (spacing, indentation)
- -unlexer=textlit like text, but remove string literal quotes
- -unlexer=codelit like code, but remove string literal quotes
- -unlexer=concat remove all spaces
- -unlexer=bind like identity, but bind at "&+"
-
--mark, marking of parts of tree in linearization. The default is none.
- -mark=metacat append "+CAT" to every metavariable, showing its category
- -mark=struct show tree structure with brackets
- -mark=java show tree structure with XML tags (used in gfeditor)
-
--coding, Some grammars are in UTF-8, some in isolatin-1.
- If the letters ä (a-umlaut) and ö (o-umlaut) look strange, either
- change your terminal to isolatin-1, or rewrite the grammar with
- 'pg -utf8'.
-
--- *: Commands and options marked with * are not currently implemented.
diff --git a/src/Makefile b/src/Makefile
deleted file mode 100644
index e4c6bb728..000000000
--- a/src/Makefile
+++ /dev/null
@@ -1,250 +0,0 @@
-include config.mk
-
-
-GHMAKE=$(GHC) --make
-GHCXMAKE=ghcxmake
-GHCFLAGS+= -fglasgow-exts
-GHCOPTFLAGS=-O2
-GHCFUDFLAG=
-
-DIST_DIR=GF-$(PACKAGE_VERSION)
-NOT_IN_DIST= \
- grammars \
- download \
- doc/release2.html \
- src/tools/AlphaConvGF.hs
-
-BIN_DIST_DIR=$(DIST_DIR)-$(host)
-
-GRAMMAR_PACKAGE_VERSION=$(shell date +%Y%m%d)
-GRAMMAR_DIST_DIR=gf-grammars-$(GRAMMAR_PACKAGE_VERSION)
-
-MSI_FILE=gf-$(subst .,_,$(PACKAGE_VERSION)).msi
-
-GF_DATA_DIR=$(datadir)/GF-$(PACKAGE_VERSION)
-GF_LIB_DIR=$(GF_DATA_DIR)/lib
-
-EMBED = GF/Embed/TemplateApp
-
-# use the temporary binary file name 'gf-bin' to not clash with directory 'GF'
-# on case insensitive file systems (such as FAT)
-GF_EXE=gf$(EXEEXT)
-GF_EXE_TMP=gf-bin$(EXEEXT)
-GF_DOC_EXE=gfdoc$(EXEEXT)
-
-
-ifeq ("$(READLINE)","readline")
- GHCFLAGS += -package readline -DUSE_READLINE
-endif
-
-ifneq ("$(CPPFLAGS)","")
- GHCFLAGS += $(addprefix -optP, $(CPPFLAGS))
-endif
-
-ifneq ("$(LDFLAGS)","")
- GHCFLAGS += $(addprefix -optl, $(LDFLAGS))
-endif
-
-ifeq ("$(INTERRUPT)","yes")
- GHCFLAGS += -DUSE_INTERRUPT
-endif
-
-ifeq ("$(ATK)","yes")
- GHCFLAGS += -DUSE_ATK
-endif
-
-ifeq ("$(ENABLE_JAVA)", "yes")
- BUILD_JAR=jar
-else
- BUILD_JAR=
-endif
-
-.PHONY: all unix jar tags gfdoc windows install install-gf \
- lib temp install-gfdoc \
- today help clean windows-msi dist gfc
-
-all: unix gfc lib
-
-static: GHCFLAGS += -optl-static
-static: unix
-
-
-gf: unix
-
-unix: today opt
-
-windows: unix
-
-temp: today noopt
-
-
-build:
- $(GHMAKE) $(GHCFLAGS) GF.hs -o $(GF_EXE_TMP)
- strip $(GF_EXE_TMP)
- mv $(GF_EXE_TMP) ../bin/$(GF_EXE)
-
-opt: GHCFLAGS += $(GHCOPTFLAGS)
-opt: build
-
-embed: GHCFLAGS += $(GHCOPTFLAGS)
-embed:
- $(GHMAKE) $(GHCFLAGS) $(EMBED) -o $(EMBED)
- strip $(EMBED)
-
-noopt: build
-
-clean:
- find . '(' -name '*~' -o -name '*.hi' -o -name '*.ghi' -o -name '*.o' ')' -exec rm -f '{}' ';'
- -rm -f gf.wixobj
- -rm -f ../bin/$(GF_EXE)
- $(MAKE) -C tools/c clean
- $(MAKE) -C ../lib/c clean
- -rm -f ../bin/gfcc2c
-
-distclean: clean
- -rm -f tools/$(GF_DOC_EXE)
- -rm -f config.status config.mk config.log
- -rm -f *.tgz *.zip
- -rm -rf $(DIST_DIR) $(BIN_DIST_DIR)
- -rm -rf gf.wxs *.msi
-
-today:
- echo 'module Paths_gf (version, getDataDir) where' > Paths_gf.hs
- echo 'import Data.Version' >> Paths_gf.hs
- echo '{-# NOINLINE version #-}' >> Paths_gf.hs
- echo 'version :: Version' >> Paths_gf.hs
- echo 'version = Version {versionBranch = [3,0], versionTags = ["beta3"]}' >> Paths_gf.hs
- echo 'getDataDir = return "$(GF_DATA_DIR)" :: IO FilePath' >> Paths_gf.hs
-
-
-showflags:
- @echo $(GHCFLAGS)
-
-# added by peb:
-tracing: GHCFLAGS += -DTRACING
-tracing: temp
-
-ghci-trace: GHCFLAGS += -DTRACING
-ghci-trace: ghci
-
-#touch-files:
-# rm -f GF/System/Tracing.{hi,o}
-# touch GF/System/Tracing.hs
-
-# profiling
-prof: GHCOPTFLAGS += -prof -auto-all
-prof: unix
-
-tags:
- find GF Transfer -name '*.hs' | xargs hasktags
-
-#
-# Help file
-#
-
-tools/MkHelpFile: tools/MkHelpFile.hs
- $(GHMAKE) -o $@ $^
-
-help: GF/Shell/HelpFile.hs
-
-GF/Shell/HelpFile.hs: tools/MkHelpFile HelpFile
- tools/MkHelpFile
-
-#
-# Tools
-#
-
-gfdoc: tools/$(GF_DOC_EXE)
-
-tools/$(GF_DOC_EXE): tools/GFDoc.hs
- $(GHMAKE) $(GHCOPTFLAGS) -o $@ $^
-
-gfc: gf
- echo GFC!
- cp -f gfc ../bin/
- chmod a+x ../bin/gfc
-
-gfcc2c:
- $(MAKE) -C tools/c
- $(MAKE) -C ../lib/c
- mv tools/c/gfcc2c ../bin
-
-#
-# Resource grammars
-#
-
-lib:
- $(MAKE) -C ../lib/resource clean all
-
-#
-# Distribution
-#
-
-dist:
- -rm -rf $(DIST_DIR)
- darcs dist --dist-name=$(DIST_DIR)
- tar -zxf ../$(DIST_DIR).tar.gz
- rm ../$(DIST_DIR).tar.gz
- cd $(DIST_DIR)/src && perl -pi -e "s/^AC_INIT\(\[GF\],\[[^\]]*\]/AC_INIT([GF],[$(PACKAGE_VERSION)]/" configure.ac
- cd $(DIST_DIR)/src && autoconf && rm -rf autom4te.cache
-# cd $(DIST_DIR)/grammars && sh mkLib.sh
- cd $(DIST_DIR) && rm -rf $(NOT_IN_DIST)
- $(TAR) -zcf $(DIST_DIR).tgz $(DIST_DIR)
- rm -rf $(DIST_DIR)
-
-snapshot: PACKAGE_VERSION=$(shell date +%Y%m%d)
-snapshot: DIST_DIR=GF-$(PACKAGE_VERSION)
-snapshot: dist
-
-rpm: dist
- rpmbuild -ta $(DIST_DIR).tgz
-
-
-binary-dist:
- rm -rf $(BIN_DIST_DIR)
- mkdir $(BIN_DIST_DIR)
- mkdir $(BIN_DIST_DIR)/lib
- ./configure --host="$(host)" --build="$(build)"
- $(MAKE) gfc gfdoc
- $(INSTALL) ../bin/$(GF_EXE) tools/$(GF_DOC_EXE) $(BIN_DIST_DIR)
- $(INSTALL) configure config.guess config.sub install-sh config.mk.in $(BIN_DIST_DIR)
- $(INSTALL) gfc.in $(BIN_DIST_DIR)
- $(INSTALL) -m 0644 ../README ../LICENSE $(BIN_DIST_DIR)
- $(INSTALL) -m 0644 INSTALL.binary $(BIN_DIST_DIR)/INSTALL
- $(INSTALL) -m 0644 Makefile.binary $(BIN_DIST_DIR)/Makefile
-# $(TAR) -C $(BIN_DIST_DIR)/lib -zxf ../lib/compiled.tgz
- $(TAR) -zcf GF-$(PACKAGE_VERSION)-$(host).tgz $(BIN_DIST_DIR)
- rm -rf $(BIN_DIST_DIR)
-
-grammar-dist:
- -rm -rf $(GRAMMAR_DIST_DIR)
- mkdir $(GRAMMAR_DIST_DIR)
- cp -r ../_darcs/current/{lib,examples} $(GRAMMAR_DIST_DIR)
- $(MAKE) GF_LIB_PATH=.. -C $(GRAMMAR_DIST_DIR)/lib/resource-1.0 show-path prelude present alltenses mathematical api multimodal langs
- $(TAR) -zcf $(GRAMMAR_DIST_DIR).tgz $(GRAMMAR_DIST_DIR)
- rm -rf $(GRAMMAR_DIST_DIR)
-
-gf.wxs: config.status gf.wxs.in
- ./config.status --file=$@
-
-windows-msi: gf.wxs
- candle -nologo gf.wxs
- light -nologo -o $(MSI_FILE) gf.wixobj
-
-#
-# Installation
-#
-
-install: install-gf install-gfdoc install-lib
-
-install-gf:
- $(INSTALL) -d $(bindir)
- $(INSTALL) ../bin/$(GF_EXE) $(bindir)
-
-install-gfdoc:
- $(INSTALL) -d $(bindir)
- $(INSTALL) tools/$(GF_DOC_EXE) $(bindir)
-
-install-lib:
- $(INSTALL) -d $(GF_LIB_DIR)
- $(TAR) -C $(GF_LIB_DIR) -zxf ../lib/compiled.tgz
diff --git a/src/Makefile.binary b/src/Makefile.binary
deleted file mode 100644
index 0ae18a2e7..000000000
--- a/src/Makefile.binary
+++ /dev/null
@@ -1,20 +0,0 @@
-include config.mk
-
-GF_DATA_DIR=$(datadir)/GF-$(PACKAGE_VERSION)
-GF_LIB_DIR=$(GF_DATA_DIR)/lib
-
-.PHONY: install uninstall
-
-install:
- $(INSTALL) -d $(bindir)
- $(INSTALL) gf$(EXEEXT) gfdoc$(EXEEXT) $(bindir)
- $(INSTALL) gfc$(EXEEXT) $(bindir)
- $(INSTALL) -d $(GF_DATA_DIR)
- cp -r lib $(GF_DATA_DIR)
-
-uninstall:
- -rm -f $(bindir)/gf$(EXEEXT) $(bindir)/gfdoc$(EXEEXT)
- -rm -f $GF_LIB_DIR)/*/*.gf{o}
- -rmdir $(GF_LIB_DIR)/*
- -rmdir $(GF_LIB_DIR)
- -rmdir $(GF_DATA_DIR)
diff --git a/src/PGF/doc/Eng.gf b/src/PGF/doc/Eng.gf
deleted file mode 100644
index c64f46313..000000000
--- a/src/PGF/doc/Eng.gf
+++ /dev/null
@@ -1,13 +0,0 @@
-concrete Eng of Ex = {
- lincat
- S = {s : Str} ;
- NP = {s : Str ; n : Num} ;
- VP = {s : Num => Str} ;
- param
- Num = Sg | Pl ;
- lin
- Pred np vp = {s = np.s ++ vp.s ! np.n} ;
- She = {s = "she" ; n = Sg} ;
- They = {s = "they" ; n = Pl} ;
- Sleep = {s = table {Sg => "sleeps" ; Pl => "sleep"}} ;
-}
diff --git a/src/PGF/doc/Ex.gf b/src/PGF/doc/Ex.gf
deleted file mode 100644
index bd0b03483..000000000
--- a/src/PGF/doc/Ex.gf
+++ /dev/null
@@ -1,8 +0,0 @@
-abstract Ex = {
- cat
- S ; NP ; VP ;
- fun
- Pred : NP -> VP -> S ;
- She, They : NP ;
- Sleep : VP ;
-}
diff --git a/src/PGF/doc/Swe.gf b/src/PGF/doc/Swe.gf
deleted file mode 100644
index 1d6672371..000000000
--- a/src/PGF/doc/Swe.gf
+++ /dev/null
@@ -1,13 +0,0 @@
-concrete Swe of Ex = {
- lincat
- S = {s : Str} ;
- NP = {s : Str} ;
- VP = {s : Str} ;
- param
- Num = Sg | Pl ;
- lin
- Pred np vp = {s = np.s ++ vp.s} ;
- She = {s = "hon"} ;
- They = {s = "de"} ;
- Sleep = {s = "sover"} ;
-}
diff --git a/src/PGF/doc/Test.gf b/src/PGF/doc/Test.gf
deleted file mode 100644
index 5cd4c5474..000000000
--- a/src/PGF/doc/Test.gf
+++ /dev/null
@@ -1,64 +0,0 @@
--- to test GFCC compilation
-
-flags coding=utf8 ;
-
-cat S ; NP ; N ; VP ;
-
-fun Pred : NP -> VP -> S ;
-fun Pred2 : NP -> VP -> NP -> S ;
-fun Det, Dets : N -> NP ;
-fun Mina, Sina, Me, Te : NP ;
-fun Raha, Paska, Pallo : N ;
-fun Puhua, Munia, Sanoa : VP ;
-
-param Person = P1 | P2 | P3 ;
-param Number = Sg | Pl ;
-param Case = Nom | Part ;
-
-param NForm = NF Number Case ;
-param VForm = VF Number Person ;
-
-lincat N = Noun ;
-lincat VP = Verb ;
-
-oper Noun = {s : NForm => Str} ;
-oper Verb = {s : VForm => Str} ;
-
-lincat NP = {s : Case => Str ; a : {n : Number ; p : Person}} ;
-
-lin Pred np vp = {s = np.s ! Nom ++ vp.s ! VF np.a.n np.a.p} ;
-lin Pred2 np vp ob = {s = np.s ! Nom ++ vp.s ! VF np.a.n np.a.p ++ ob.s ! Part} ;
-lin Det no = {s = \\c => no.s ! NF Sg c ; a = {n = Sg ; p = P3}} ;
-lin Dets no = {s = \\c => no.s ! NF Pl c ; a = {n = Pl ; p = P3}} ;
-lin Mina = {s = table Case ["minä" ; "minua"] ; a = {n = Sg ; p = P1}} ;
-lin Te = {s = table Case ["te" ; "teitä"] ; a = {n = Pl ; p = P2}} ;
-lin Sina = {s = table Case ["sinä" ; "sinua"] ; a = {n = Sg ; p = P2}} ;
-lin Me = {s = table Case ["me" ; "meitä"] ; a = {n = Pl ; p = P1}} ;
-
-lin Raha = mkN "raha" ;
-lin Paska = mkN "paska" ;
-lin Pallo = mkN "pallo" ;
-lin Puhua = mkV "puhu" ;
-lin Munia = mkV "muni" ;
-lin Sanoa = mkV "sano" ;
-
-oper mkN : Str -> Noun = \raha -> {
- s = table {
- NF Sg Nom => raha ;
- NF Sg Part => raha + "a" ;
- NF Pl Nom => raha + "t" ;
- NF Pl Part => Predef.tk 1 raha + "oja"
- }
- } ;
-
-oper mkV : Str -> Verb = \puhu -> {
- s = table {
- VF Sg P1 => puhu + "n" ;
- VF Sg P2 => puhu + "t" ;
- VF Sg P3 => puhu + Predef.dp 1 puhu ;
- VF Pl P1 => puhu + "mme" ;
- VF Pl P2 => puhu + "tte" ;
- VF Pl P3 => puhu + "vat"
- }
- } ;
-
diff --git a/src/PGF/doc/gfcc.html b/src/PGF/doc/gfcc.html
deleted file mode 100644
index 8f8c478c0..000000000
--- a/src/PGF/doc/gfcc.html
+++ /dev/null
@@ -1,809 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<HTML>
-<HEAD>
-<META NAME="generator" CONTENT="http://txt2tags.sf.net">
-<TITLE>The GFCC Grammar Format</TITLE>
-</HEAD><BODY BGCOLOR="white" TEXT="black">
-<P ALIGN="center"><CENTER><H1>The GFCC Grammar Format</H1>
-<FONT SIZE="4">
-<I>Aarne Ranta</I><BR>
-October 5, 2007
-</FONT></CENTER>
-
-<P>
-Author's address:
-<A HREF="http://www.cs.chalmers.se/~aarne"><CODE>http://www.cs.chalmers.se/~aarne</CODE></A>
-</P>
-<P>
-History:
-</P>
-<UL>
-<LI>5 Oct 2007: new, better structured GFCC with full expressive power
-<LI>19 Oct: translation of lincats, new figures on C++
-<LI>3 Oct 2006: first version
-</UL>
-
-<H2>What is GFCC</H2>
-<P>
-GFCC is a low-level format for GF grammars. Its aim is to contain the minimum
-that is needed to process GF grammars at runtime. This minimality has three
-advantages:
-</P>
-<UL>
-<LI>compact grammar files and run-time objects
-<LI>time and space efficient processing
-<LI>simple definition of interpreters
-</UL>
-
-<P>
-Thus we also want to call GFCC the <B>portable grammar format</B>.
-</P>
-<P>
-The idea is that all embedded GF applications use GFCC.
-The GF system would be primarily used as a compiler and as a grammar
-development tool.
-</P>
-<P>
-Since GFCC is implemented in BNFC, a parser of the format is readily
-available for C, C++, C#, Haskell, Java, and OCaml. Also an XML
-representation can be generated in BNFC. A
-<A HREF="../">reference implementation</A>
-of linearization and some other functions has been written in Haskell.
-</P>
-<H2>GFCC vs. GFC</H2>
-<P>
-GFCC is aimed to replace GFC as the run-time grammar format. GFC was designed
-to be a run-time format, but also to
-support separate compilation of grammars, i.e.
-to store the results of compiling
-individual GF modules. But this means that GFC has to contain extra information,
-such as type annotations, which is only needed in compilation and not at
-run-time. In particular, the pattern matching syntax and semantics of GFC is
-complex and therefore difficult to implement in new platforms.
-</P>
-<P>
-Actually, GFC is planned to be omitted also as the target format of
-separate compilation, where plain GF (type annotated and partially evaluated)
-will be used instead. GFC provides only marginal advantages as a target format
-compared with GF, and it is therefore just extra weight to carry around this
-format.
-</P>
-<P>
-The main differences of GFCC compared with GFC (and GF) can be summarized as follows:
-</P>
-<UL>
-<LI>there are no modules, and therefore no qualified names
-<LI>a GFCC grammar is multilingual, and consists of a common abstract syntax
- together with one concrete syntax per language
-<LI>records and tables are replaced by arrays
-<LI>record labels and parameter values are replaced by integers
-<LI>record projection and table selection are replaced by array indexing
-<LI>even though the format does support dependent types and higher-order abstract
- syntax, there is no interpreted yet that does this
-</UL>
-
-<P>
-Here is an example of a GF grammar, consisting of three modules,
-as translated to GFCC. The representations are aligned; thus they do not completely
-reflect the order of judgements in GFCC files, which have different orders of
-blocks of judgements, and alphabetical sorting.
-</P>
-<PRE>
- grammar Ex(Eng,Swe);
-
- abstract Ex = { abstract {
- cat cat
- S ; NP ; VP ; NP[]; S[]; VP[];
- fun fun
- Pred : NP -&gt; VP -&gt; S ; Pred=[(($ 0! 1),(($ 1! 0)!($ 0! 0)))];
- She, They : NP ; She=[0,"she"];
- Sleep : VP ; They=[1,"they"];
- Sleep=[["sleeps","sleep"]];
- } } ;
-
- concrete Eng of Ex = { concrete Eng {
- lincat lincat
- S = {s : Str} ; S=[()];
- NP = {s : Str ; n : Num} ; NP=[1,()];
- VP = {s : Num =&gt; Str} ; VP=[[(),()]];
- param
- Num = Sg | Pl ;
- lin lin
- Pred np vp = { Pred=[(($ 0! 1),(($ 1! 0)!($ 0! 0)))];
- s = np.s ++ vp.s ! np.n} ;
- She = {s = "she" ; n = Sg} ; She=[0,"she"];
- They = {s = "they" ; n = Pl} ; They = [1, "they"];
- Sleep = {s = table { Sleep=[["sleeps","sleep"]];
- Sg =&gt; "sleeps" ;
- Pl =&gt; "sleep"
- }
- } ;
- } } ;
-
- concrete Swe of Ex = { concrete Swe {
- lincat lincat
- S = {s : Str} ; S=[()];
- NP = {s : Str} ; NP=[()];
- VP = {s : Str} ; VP=[()];
- param
- Num = Sg | Pl ;
- lin lin
- Pred np vp = { Pred = [(($0!0),($1!0))];
- s = np.s ++ vp.s} ;
- She = {s = "hon"} ; She = ["hon"];
- They = {s = "de"} ; They = ["de"];
- Sleep = {s = "sover"} ; Sleep = ["sover"];
- } } ;
-</PRE>
-<P></P>
-<H2>The syntax of GFCC files</H2>
-<P>
-The complete BNFC grammar, from which
-the rules in this section are taken, is in the file
-<A HREF="../DataGFCC.cf"><CODE>GF/GFCC/GFCC.cf</CODE></A>.
-</P>
-<H3>Top level</H3>
-<P>
-A grammar has a header telling the name of the abstract syntax
-(often specifying an application domain), and the names of
-the concrete languages. The abstract syntax and the concrete
-syntaxes themselves follow.
-</P>
-<PRE>
- Grm. Grammar ::=
- "grammar" CId "(" [CId] ")" ";"
- Abstract ";"
- [Concrete] ;
-
- Abs. Abstract ::=
- "abstract" "{"
- "flags" [Flag]
- "fun" [FunDef]
- "cat" [CatDef]
- "}" ;
-
- Cnc. Concrete ::=
- "concrete" CId "{"
- "flags" [Flag]
- "lin" [LinDef]
- "oper" [LinDef]
- "lincat" [LinDef]
- "lindef" [LinDef]
- "printname" [LinDef]
- "}" ;
-</PRE>
-<P>
-This syntax organizes each module to a sequence of <B>fields</B>, such
-as flags, linearizations, operations, linearization types, etc.
-It is envisaged that particular applications can ignore some
-of the fields, typically so that earlier fields are more
-important than later ones.
-</P>
-<P>
-The judgement forms have the following syntax.
-</P>
-<PRE>
- Flg. Flag ::= CId "=" String ;
- Cat. CatDef ::= CId "[" [Hypo] "]" ;
- Fun. FunDef ::= CId ":" Type "=" Exp ;
- Lin. LinDef ::= CId "=" Term ;
-</PRE>
-<P>
-For the run-time system, the reference implementation in Haskell
-uses a structure that gives efficient look-up:
-</P>
-<PRE>
- data GFCC = GFCC {
- absname :: CId ,
- cncnames :: [CId] ,
- abstract :: Abstr ,
- concretes :: Map CId Concr
- }
-
- data Abstr = Abstr {
- aflags :: Map CId String, -- value of a flag
- funs :: Map CId (Type,Exp), -- type and def of a fun
- cats :: Map CId [Hypo], -- context of a cat
- catfuns :: Map CId [CId] -- funs yielding a cat (redundant, for fast lookup)
- }
-
- data Concr = Concr {
- flags :: Map CId String, -- value of a flag
- lins :: Map CId Term, -- lin of a fun
- opers :: Map CId Term, -- oper generated by subex elim
- lincats :: Map CId Term, -- lin type of a cat
- lindefs :: Map CId Term, -- lin default of a cat
- printnames :: Map CId Term -- printname of a cat or a fun
- }
-</PRE>
-<P>
-These definitions are from <A HREF="../DataGFCC.hs"><CODE>GF/GFCC/DataGFCC.hs</CODE></A>.
-</P>
-<P>
-Identifiers (<CODE>CId</CODE>) are like <CODE>Ident</CODE> in GF, except that
-the compiler produces constants prefixed with <CODE>_</CODE> in
-the common subterm elimination optimization.
-</P>
-<PRE>
- token CId (('_' | letter) (letter | digit | '\'' | '_')*) ;
-</PRE>
-<P></P>
-<H3>Abstract syntax</H3>
-<P>
-Types are first-order function types built from argument type
-contexts and value types.
-category symbols. Syntax trees (<CODE>Exp</CODE>) are
-rose trees with nodes consisting of a head (<CODE>Atom</CODE>) and
-bound variables (<CODE>CId</CODE>).
-</P>
-<PRE>
- DTyp. Type ::= "[" [Hypo] "]" CId [Exp] ;
- DTr. Exp ::= "[" "(" [CId] ")" Atom [Exp] "]" ;
- Hyp. Hypo ::= CId ":" Type ;
-</PRE>
-<P>
-The head Atom is either a function
-constant, a bound variable, or a metavariable, or a string, integer, or float
-literal.
-</P>
-<PRE>
- AC. Atom ::= CId ;
- AS. Atom ::= String ;
- AI. Atom ::= Integer ;
- AF. Atom ::= Double ;
- AM. Atom ::= "?" Integer ;
-</PRE>
-<P>
-The context-free types and trees of the "old GFCC" are special
-cases, which can be defined as follows:
-</P>
-<PRE>
- Typ. Type ::= [CId] "-&gt;" CId
- Typ args val = DTyp [Hyp (CId "_") arg | arg &lt;- args] val
-
- Tr. Exp ::= "(" CId [Exp] ")"
- Tr fun exps = DTr [] fun exps
-</PRE>
-<P>
-To store semantic (<CODE>def</CODE>) definitions by cases, the following expression
-form is provided, but it is only meaningful in the last field of a function
-declaration in an abstract syntax:
-</P>
-<PRE>
- EEq. Exp ::= "{" [Equation] "}" ;
- Equ. Equation ::= [Exp] "-&gt;" Exp ;
-</PRE>
-<P>
-Notice that expressions are used to encode patterns. Primitive notions
-(the default semantics in GF) are encoded as empty sets of equations
-(<CODE>[]</CODE>). For a constructor (canonical form) of a category <CODE>C</CODE>, we
-aim to use the encoding as the application <CODE>(_constr C)</CODE>.
-</P>
-<H3>Concrete syntax</H3>
-<P>
-Linearization terms (<CODE>Term</CODE>) are built as follows.
-Constructor names are shown to make the later code
-examples readable.
-</P>
-<PRE>
- R. Term ::= "[" [Term] "]" ; -- array (record/table)
- P. Term ::= "(" Term "!" Term ")" ; -- access to field (projection/selection)
- S. Term ::= "(" [Term] ")" ; -- concatenated sequence
- K. Term ::= Tokn ; -- token
- V. Term ::= "$" Integer ; -- argument (subtree)
- C. Term ::= Integer ; -- array index (label/parameter value)
- FV. Term ::= "[|" [Term] "|]" ; -- free variation
- TM. Term ::= "?" ; -- linearization of metavariable
-</PRE>
-<P>
-Tokens are strings or (maybe obsolescent) prefix-dependent
-variant lists.
-</P>
-<PRE>
- KS. Tokn ::= String ;
- KP. Tokn ::= "[" "pre" [String] "[" [Variant] "]" "]" ;
- Var. Variant ::= [String] "/" [String] ;
-</PRE>
-<P>
-Two special forms of terms are introduced by the compiler
-as optimizations. They can in principle be eliminated, but
-their presence makes grammars much more compact. Their semantics
-will be explained in a later section.
-</P>
-<PRE>
- F. Term ::= CId ; -- global constant
- W. Term ::= "(" String "+" Term ")" ; -- prefix + suffix table
-</PRE>
-<P>
-There is also a deprecated form of "record parameter alias",
-</P>
-<PRE>
- RP. Term ::= "(" Term "@" Term ")"; -- DEPRECATED
-</PRE>
-<P>
-which will be removed when the migration to new GFCC is complete.
-</P>
-<H2>The semantics of concrete syntax terms</H2>
-<P>
-The code in this section is from <A HREF="../Linearize.hs"><CODE>GF/GFCC/Linearize.hs</CODE></A>.
-</P>
-<H3>Linearization and realization</H3>
-<P>
-The linearization algorithm is essentially the same as in
-GFC: a tree is linearized by evaluating its linearization term
-in the environment of the linearizations of the subtrees.
-Literal atoms are linearized in the obvious way.
-The function also needs to know the language (i.e. concrete syntax)
-in which linearization is performed.
-</P>
-<PRE>
- linExp :: GFCC -&gt; CId -&gt; Exp -&gt; Term
- linExp gfcc lang tree@(DTr _ at trees) = case at of
- AC fun -&gt; comp (Prelude.map lin trees) $ look fun
- AS s -&gt; R [kks (show s)] -- quoted
- AI i -&gt; R [kks (show i)]
- AF d -&gt; R [kks (show d)]
- AM -&gt; TM
- where
- lin = linExp gfcc lang
- comp = compute gfcc lang
- look = lookLin gfcc lang
-</PRE>
-<P>
-TODO: bindings must be supported.
-</P>
-<P>
-The result of linearization is usually a record, which is realized as
-a string using the following algorithm.
-</P>
-<PRE>
- realize :: Term -&gt; String
- realize trm = case trm of
- R (t:_) -&gt; realize t
- S ss -&gt; unwords $ Prelude.map realize ss
- K (KS s) -&gt; s
- K (KP s _) -&gt; unwords s ---- prefix choice TODO
- W s t -&gt; s ++ realize t
- FV (t:_) -&gt; realize t
- TM -&gt; "?"
-</PRE>
-<P>
-Notice that realization always picks the first field of a record.
-If a linearization type has more than one field, the first field
-does not necessarily contain the desired string.
-Also notice that the order of record fields in GFCC is not necessarily
-the same as in GF source.
-</P>
-<H3>Term evaluation</H3>
-<P>
-Evaluation follows call-by-value order, with two environments
-needed:
-</P>
-<UL>
-<LI>the grammar (a concrete syntax) to give the global constants
-<LI>an array of terms to give the subtree linearizations
-</UL>
-
-<P>
-The code is presented in one-level pattern matching, to
-enable reimplementations in languages that do not permit
-deep patterns (such as Java and C++).
-</P>
-<PRE>
- compute :: GFCC -&gt; CId -&gt; [Term] -&gt; Term -&gt; Term
- compute gfcc lang args = comp where
- comp trm = case trm of
- P r p -&gt; proj (comp r) (comp p)
- W s t -&gt; W s (comp t)
- R ts -&gt; R $ Prelude.map comp ts
- V i -&gt; idx args (fromInteger i) -- already computed
- F c -&gt; comp $ look c -- not computed (if contains V)
- FV ts -&gt; FV $ Prelude.map comp ts
- S ts -&gt; S $ Prelude.filter (/= S []) $ Prelude.map comp ts
- _ -&gt; trm
-
- look = lookOper gfcc lang
-
- idx xs i = xs !! i
-
- proj r p = case (r,p) of
- (_, FV ts) -&gt; FV $ Prelude.map (proj r) ts
- (W s t, _) -&gt; kks (s ++ getString (proj t p))
- _ -&gt; comp $ getField r (getIndex p)
-
- getString t = case t of
- K (KS s) -&gt; s
- _ -&gt; trace ("ERROR in grammar compiler: string from "++ show t) "ERR"
-
- getIndex t = case t of
- C i -&gt; fromInteger i
- RP p _ -&gt; getIndex p
- TM -&gt; 0 -- default value for parameter
- _ -&gt; trace ("ERROR in grammar compiler: index from " ++ show t) 0
-
- getField t i = case t of
- R rs -&gt; idx rs i
- RP _ r -&gt; getField r i
- TM -&gt; TM
- _ -&gt; trace ("ERROR in grammar compiler: field from " ++ show t) t
-</PRE>
-<P></P>
-<H3>The special term constructors</H3>
-<P>
-The three forms introduced by the compiler may a need special
-explanation.
-</P>
-<P>
-Global constants
-</P>
-<PRE>
- Term ::= CId ;
-</PRE>
-<P>
-are shorthands for complex terms. They are produced by the
-compiler by (iterated) <B>common subexpression elimination</B>.
-They are often more powerful than hand-devised code sharing in the source
-code. They could be computed off-line by replacing each identifier by
-its definition.
-</P>
-<P>
-<B>Prefix-suffix tables</B>
-</P>
-<PRE>
- Term ::= "(" String "+" Term ")" ;
-</PRE>
-<P>
-represent tables of word forms divided to the longest common prefix
-and its array of suffixes. In the example grammar above, we have
-</P>
-<PRE>
- Sleep = [("sleep" + ["s",""])]
-</PRE>
-<P>
-which in fact is equal to the array of full forms
-</P>
-<PRE>
- ["sleeps", "sleep"]
-</PRE>
-<P>
-The power of this construction comes from the fact that suffix sets
-tend to be repeated in a language, and can therefore be collected
-by common subexpression elimination. It is this technique that
-explains the used syntax rather than the more accurate
-</P>
-<PRE>
- "(" String "+" [String] ")"
-</PRE>
-<P>
-since we want the suffix part to be a <CODE>Term</CODE> for the optimization to
-take effect.
-</P>
-<H2>Compiling to GFCC</H2>
-<P>
-Compilation to GFCC is performed by the GF grammar compiler, and
-GFCC interpreters need not know what it does. For grammar writers,
-however, it might be interesting to know what happens to the grammars
-in the process.
-</P>
-<P>
-The compilation phases are the following
-</P>
-<OL>
-<LI>type check and partially evaluate GF source
-<LI>create a symbol table mapping the GF parameter and record types to
- fixed-size arrays, and parameter values and record labels to integers
-<LI>traverse the linearization rules replacing parameters and labels by integers
-<LI>reorganize the created GF grammar so that it has just one abstract syntax
- and one concrete syntax per language
-<LI>TODO: apply UTF8 encoding to the grammar, if not yet applied (this is told by the
- <CODE>coding</CODE> flag)
-<LI>translate the GF grammar object to a GFCC grammar object, using a simple
- compositional mapping
-<LI>perform the word-suffix optimization on GFCC linearization terms
-<LI>perform subexpression elimination on each concrete syntax module
-<LI>print out the GFCC code
-</OL>
-
-<H3>Problems in GFCC compilation</H3>
-<P>
-Two major problems had to be solved in compiling GF to GFCC:
-</P>
-<UL>
-<LI>consistent order of tables and records, to permit the array translation
-<LI>run-time variables in complex parameter values.
-</UL>
-
-<P>
-The current implementation is still experimental and may fail
-to generate correct code. Any errors remaining are likely to be
-related to the two problems just mentioned.
-</P>
-<P>
-The order problem is solved in slightly different ways for tables and records.
-In both cases, <B>eta expansion</B> is used to establish a
-canonical order. Tables are ordered by applying the preorder induced
-by <CODE>param</CODE> definitions. Records are ordered by sorting them by labels.
-This means that
-e.g. the <CODE>s</CODE> field will in general no longer appear as the first
-field, even if it does so in the GF source code. But relying on the
-order of fields in a labelled record would be misplaced anyway.
-</P>
-<P>
-The canonical form of records is further complicated by lock fields,
-i.e. dummy fields of form <CODE>lock_C = &lt;&gt;</CODE>, which are added to grammar
-libraries to force intensionality of linearization types. The problem
-is that the absence of a lock field only generates a warning, not
-an error. Therefore a GF grammar can contain objects of the same
-type with and without a lock field. This problem was solved in GFCC
-generation by just removing all lock fields (defined as fields whose
-type is the empty record type). This has the further advantage of
-(slightly) reducing the grammar size. More importantly, it is safe
-to remove lock fields, because they are never used in computation,
-and because intensional types are only needed in grammars reused
-as libraries, not in grammars used at runtime.
-</P>
-<P>
-While the order problem is rather bureaucratic in nature, run-time
-variables are an interesting problem. They arise in the presence
-of complex parameter values, created by argument-taking constructors
-and parameter records. To give an example, consider the GF parameter
-type system
-</P>
-<PRE>
- Number = Sg | Pl ;
- Person = P1 | P2 | P3 ;
- Agr = Ag Number Person ;
-</PRE>
-<P>
-The values can be translated to integers in the expected way,
-</P>
-<PRE>
- Sg = 0, Pl = 1
- P1 = 0, P2 = 1, P3 = 2
- Ag Sg P1 = 0, Ag Sg P2 = 1, Ag Sg P3 = 2,
- Ag Pl P1 = 3, Ag Pl P2 = 4, Ag Pl P3 = 5
-</PRE>
-<P>
-However, an argument of <CODE>Agr</CODE> can be a run-time variable, as in
-</P>
-<PRE>
- Ag np.n P3
-</PRE>
-<P>
-This expression must first be translated to a case expression,
-</P>
-<PRE>
- case np.n of {
- 0 =&gt; 2 ;
- 1 =&gt; 5
- }
-</PRE>
-<P>
-which can then be translated to the GFCC term
-</P>
-<PRE>
- ([2,5] ! ($0 ! $1))
-</PRE>
-<P>
-assuming that the variable <CODE>np</CODE> is the first argument and that its
-<CODE>Number</CODE> field is the second in the record.
-</P>
-<P>
-This transformation of course has to be performed recursively, since
-there can be several run-time variables in a parameter value:
-</P>
-<PRE>
- Ag np.n np.p
-</PRE>
-<P>
-A similar transformation would be possible to deal with the double
-role of parameter records discussed above. Thus the type
-</P>
-<PRE>
- RNP = {n : Number ; p : Person}
-</PRE>
-<P>
-could be uniformly translated into the set <CODE>{0,1,2,3,4,5}</CODE>
-as <CODE>Agr</CODE> above. Selections would be simple instances of indexing.
-But any projection from the record should be translated into
-a case expression,
-</P>
-<PRE>
- rnp.n ===&gt;
- case rnp of {
- 0 =&gt; 0 ;
- 1 =&gt; 0 ;
- 2 =&gt; 0 ;
- 3 =&gt; 1 ;
- 4 =&gt; 1 ;
- 5 =&gt; 1
- }
-</PRE>
-<P>
-To avoid the code bloat resulting from this, we have chosen to
-deal with records by a <B>currying</B> transformation:
-</P>
-<PRE>
- table {n : Number ; p : Person} {... ...}
- ===&gt;
- table Number {Sg =&gt; table Person {...} ; table Person {...}}
-</PRE>
-<P>
-This is performed when GFCC is generated. Selections with
-records have to be treated likewise,
-</P>
-<PRE>
- t ! r ===&gt; t ! r.n ! r.p
-</PRE>
-<P></P>
-<H3>The representation of linearization types</H3>
-<P>
-Linearization types (<CODE>lincat</CODE>) are not needed when generating with
-GFCC, but they have been added to enable parser generation directly from
-GFCC. The linearization type definitions are shown as a part of the
-concrete syntax, by using terms to represent types. Here is the table
-showing how different linearization types are encoded.
-</P>
-<PRE>
- P* = max(P) -- parameter type
- {r1 : T1 ; ... ; rn : Tn}* = [T1*,...,Tn*] -- record
- (P =&gt; T)* = [T* ,...,T*] -- table, size(P) cases
- Str* = ()
-</PRE>
-<P>
-For example, the linearization type <CODE>present/CatEng.NP</CODE> is
-translated as follows:
-</P>
-<PRE>
- NP = {
- a : { -- 6 = 2*3 values
- n : {ParamX.Number} ; -- 2 values
- p : {ParamX.Person} -- 3 values
- } ;
- s : {ResEng.Case} =&gt; Str -- 3 values
- }
-
- __NP = [[1,2],[(),(),()]]
-</PRE>
-<P></P>
-<H3>Running the compiler and the GFCC interpreter</H3>
-<P>
-GFCC generation is a part of the
-<A HREF="http://www.cs.chalmers.se/Cs/Research/Language-technology/darcs/GF/doc/darcs.html">developers' version</A>
-of GF since September 2006. To invoke the compiler, the flag
-<CODE>-printer=gfcc</CODE> to the command
-<CODE>pm = print_multi</CODE> is used. It is wise to recompile the grammar from
-source, since previously compiled libraries may not obey the canonical
-order of records.
-Here is an example, performed in
-<A HREF="../../../../../examples/bronzeage">example/bronzeage</A>.
-</P>
-<PRE>
- i -src -path=.:prelude:resource-1.0/* -optimize=all_subs BronzeageEng.gf
- i -src -path=.:prelude:resource-1.0/* -optimize=all_subs BronzeageGer.gf
- strip
- pm -printer=gfcc | wf bronze.gfcc
-</PRE>
-<P>
-There is also an experimental batch compiler, which does not use the GFC
-format or the record aliases. It can be produced by
-</P>
-<PRE>
- make gfc
-</PRE>
-<P>
-in <CODE>GF/src</CODE>, and invoked by
-</P>
-<PRE>
- gfc --make FILES
-</PRE>
-<P></P>
-<H2>The reference interpreter</H2>
-<P>
-The reference interpreter written in Haskell consists of the following files:
-</P>
-<PRE>
- -- source file for BNFC
- GFCC.cf -- labelled BNF grammar of gfcc
-
- -- files generated by BNFC
- AbsGFCC.hs -- abstrac syntax datatypes
- ErrM.hs -- error monad used internally
- LexGFCC.hs -- lexer of gfcc files
- ParGFCC.hs -- parser of gfcc files and syntax trees
- PrintGFCC.hs -- printer of gfcc files and syntax trees
-
- -- hand-written files
- DataGFCC.hs -- grammar datatype, post-parser grammar creation
- Linearize.hs -- linearization and evaluation
- Macros.hs -- utilities abstracting away from GFCC datatypes
- Generate.hs -- random and exhaustive generation, generate-and-test parsing
- API.hs -- functionalities accessible in embedded GF applications
- Generate.hs -- random and exhaustive generation
- Shell.hs -- main function - a simple command interpreter
-</PRE>
-<P>
-It is included in the
-<A HREF="http://www.cs.chalmers.se/Cs/Research/Language-technology/darcs/GF/doc/darcs.html">developers' version</A>
-of GF, in the subdirectories <A HREF="../"><CODE>GF/src/GF/GFCC</CODE></A> and
-<A HREF="../../Devel"><CODE>GF/src/GF/Devel</CODE></A>.
-</P>
-<P>
-As of September 2007, default parsing in main GF uses GFCC (implemented by Krasimir
-Angelov). The interpreter uses the relevant modules
-</P>
-<PRE>
- GF/Conversions/SimpleToFCFG.hs -- generate parser from GFCC
- GF/Parsing/FCFG.hs -- run the parser
-</PRE>
-<P></P>
-<P>
-To compile the interpreter, type
-</P>
-<PRE>
- make gfcc
-</PRE>
-<P>
-in <CODE>GF/src</CODE>. To run it, type
-</P>
-<PRE>
- ./gfcc &lt;GFCC-file&gt;
-</PRE>
-<P>
-The available commands are
-</P>
-<UL>
-<LI><CODE>gr &lt;Cat&gt; &lt;Int&gt;</CODE>: generate a number of random trees in category.
- and show their linearizations in all languages
-<LI><CODE>grt &lt;Cat&gt; &lt;Int&gt;</CODE>: generate a number of random trees in category.
- and show the trees and their linearizations in all languages
-<LI><CODE>gt &lt;Cat&gt; &lt;Int&gt;</CODE>: generate a number of trees in category from smallest,
- and show their linearizations in all languages
-<LI><CODE>gtt &lt;Cat&gt; &lt;Int&gt;</CODE>: generate a number of trees in category from smallest,
- and show the trees and their linearizations in all languages
-<LI><CODE>p &lt;Lang&gt; &lt;Cat&gt; &lt;String&gt;</CODE>: parse a string into a set of trees
-<LI><CODE>lin &lt;Tree&gt;</CODE>: linearize tree in all languages, also showing full records
-<LI><CODE>q</CODE>: terminate the system cleanly
-</UL>
-
-<H2>Embedded formats</H2>
-<UL>
-<LI>JavaScript: compiler of linearization and abstract syntax
-<P></P>
-<LI>Haskell: compiler of abstract syntax and interpreter with parsing,
- linearization, and generation
-<P></P>
-<LI>C: compiler of linearization (old GFCC)
-<P></P>
-<LI>C++: embedded interpreter supporting linearization (old GFCC)
-</UL>
-
-<H2>Some things to do</H2>
-<P>
-Support for dependent types, higher-order abstract syntax, and
-semantic definition in GFCC generation and interpreters.
-</P>
-<P>
-Replacing the entire GF shell by one based on GFCC.
-</P>
-<P>
-Interpreter in Java.
-</P>
-<P>
-Hand-written parsers for GFCC grammars to reduce code size
-(and efficiency?) of interpreters.
-</P>
-<P>
-Binary format and/or file compression of GFCC output.
-</P>
-<P>
-Syntax editor based on GFCC.
-</P>
-<P>
-Rewriting of resource libraries in order to exploit the
-word-suffix sharing better (depth-one tables, as in FM).
-</P>
-
-<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
-<!-- cmdline: txt2tags -thtml gfcc.txt -->
-</BODY></HTML>
diff --git a/src/PGF/doc/gfcc.txt b/src/PGF/doc/gfcc.txt
deleted file mode 100644
index 5dcf2fbdc..000000000
--- a/src/PGF/doc/gfcc.txt
+++ /dev/null
@@ -1,712 +0,0 @@
-The GFCC Grammar Format
-Aarne Ranta
-December 14, 2007
-
-Author's address:
-[``http://www.cs.chalmers.se/~aarne`` http://www.cs.chalmers.se/~aarne]
-
-% to compile: txt2tags -thtml --toc gfcc.txt
-
-History:
-- 14 Dec 2007: simpler, Lisp-like concrete syntax of GFCC
-- 5 Oct 2007: new, better structured GFCC with full expressive power
-- 19 Oct: translation of lincats, new figures on C++
-- 3 Oct 2006: first version
-
-
-==What is GFCC==
-
-GFCC is a low-level format for GF grammars. Its aim is to contain the minimum
-that is needed to process GF grammars at runtime. This minimality has three
-advantages:
-- compact grammar files and run-time objects
-- time and space efficient processing
-- simple definition of interpreters
-
-
-Thus we also want to call GFCC the **portable grammar format**.
-
-The idea is that all embedded GF applications use GFCC.
-The GF system would be primarily used as a compiler and as a grammar
-development tool.
-
-Since GFCC is implemented in BNFC, a parser of the format is readily
-available for C, C++, C#, Haskell, Java, and OCaml. Also an XML
-representation can be generated in BNFC. A
-[reference implementation ../]
-of linearization and some other functions has been written in Haskell.
-
-
-==GFCC vs. GFC==
-
-GFCC is aimed to replace GFC as the run-time grammar format. GFC was designed
-to be a run-time format, but also to
-support separate compilation of grammars, i.e.
-to store the results of compiling
-individual GF modules. But this means that GFC has to contain extra information,
-such as type annotations, which is only needed in compilation and not at
-run-time. In particular, the pattern matching syntax and semantics of GFC is
-complex and therefore difficult to implement in new platforms.
-
-Actually, GFC is planned to be omitted also as the target format of
-separate compilation, where plain GF (type annotated and partially evaluated)
-will be used instead. GFC provides only marginal advantages as a target format
-compared with GF, and it is therefore just extra weight to carry around this
-format.
-
-The main differences of GFCC compared with GFC (and GF) can be
-summarized as follows:
-- there are no modules, and therefore no qualified names
-- a GFCC grammar is multilingual, and consists of a common abstract syntax
- together with one concrete syntax per language
-- records and tables are replaced by arrays
-- record labels and parameter values are replaced by integers
-- record projection and table selection are replaced by array indexing
-- even though the format does support dependent types and higher-order abstract
- syntax, there is no interpreted yet that does this
-
-
-
-Here is an example of a GF grammar, consisting of three modules,
-as translated to GFCC. The representations are aligned;
-thus they do not completely
-reflect the order of judgements in GFCC files, which have different orders of
-blocks of judgements, and alphabetical sorting.
-```
- grammar Ex(Eng,Swe);
-
-abstract Ex = { abstract {
- cat cat
- S ; NP ; VP ; NP[]; S[]; VP[];
- fun fun
- Pred : NP -> VP -> S ; Pred=[(($ 0! 1),(($ 1! 0)!($ 0! 0)))];
- She, They : NP ; She=[0,"she"];
- Sleep : VP ; They=[1,"they"];
- Sleep=[["sleeps","sleep"]];
-} } ;
-
-concrete Eng of Ex = { concrete Eng {
- lincat lincat
- S = {s : Str} ; S=[()];
- NP = {s : Str ; n : Num} ; NP=[1,()];
- VP = {s : Num => Str} ; VP=[[(),()]];
- param
- Num = Sg | Pl ;
- lin lin
- Pred np vp = { Pred=[(($ 0! 1),(($ 1! 0)!($ 0! 0)))];
- s = np.s ++ vp.s ! np.n} ;
- She = {s = "she" ; n = Sg} ; She=[0,"she"];
- They = {s = "they" ; n = Pl} ; They = [1, "they"];
- Sleep = {s = table { Sleep=[["sleeps","sleep"]];
- Sg => "sleeps" ;
- Pl => "sleep"
- }
- } ;
-} } ;
-
-concrete Swe of Ex = { concrete Swe {
- lincat lincat
- S = {s : Str} ; S=[()];
- NP = {s : Str} ; NP=[()];
- VP = {s : Str} ; VP=[()];
- param
- Num = Sg | Pl ;
- lin lin
- Pred np vp = { Pred = [(($0!0),($1!0))];
- s = np.s ++ vp.s} ;
- She = {s = "hon"} ; She = ["hon"];
- They = {s = "de"} ; They = ["de"];
- Sleep = {s = "sover"} ; Sleep = ["sover"];
-} } ;
-```
-
-==The syntax of GFCC files==
-
-The complete BNFC grammar, from which
-the rules in this section are taken, is in the file
-[``GF/GFCC/GFCC.cf`` ../DataGFCC.cf].
-
-
-===Top level===
-
-A grammar has a header telling the name of the abstract syntax
-(often specifying an application domain), and the names of
-the concrete languages. The abstract syntax and the concrete
-syntaxes themselves follow.
-```
- Grm. Grammar ::=
- "grammar" CId "(" [CId] ")" ";"
- Abstract ";"
- [Concrete] ;
-
- Abs. Abstract ::=
- "abstract" "{"
- "flags" [Flag]
- "fun" [FunDef]
- "cat" [CatDef]
- "}" ;
-
- Cnc. Concrete ::=
- "concrete" CId "{"
- "flags" [Flag]
- "lin" [LinDef]
- "oper" [LinDef]
- "lincat" [LinDef]
- "lindef" [LinDef]
- "printname" [LinDef]
- "}" ;
-```
-This syntax organizes each module to a sequence of **fields**, such
-as flags, linearizations, operations, linearization types, etc.
-It is envisaged that particular applications can ignore some
-of the fields, typically so that earlier fields are more
-important than later ones.
-
-The judgement forms have the following syntax.
-```
- Flg. Flag ::= CId "=" String ;
- Cat. CatDef ::= CId "[" [Hypo] "]" ;
- Fun. FunDef ::= CId ":" Type "=" Exp ;
- Lin. LinDef ::= CId "=" Term ;
-```
-For the run-time system, the reference implementation in Haskell
-uses a structure that gives efficient look-up:
-```
- data GFCC = GFCC {
- absname :: CId ,
- cncnames :: [CId] ,
- abstract :: Abstr ,
- concretes :: Map CId Concr
- }
-
- data Abstr = Abstr {
- aflags :: Map CId String, -- value of a flag
- funs :: Map CId (Type,Exp), -- type and def of a fun
- cats :: Map CId [Hypo], -- context of a cat
- catfuns :: Map CId [CId] -- funs yielding a cat (redundant, for fast lookup)
- }
-
- data Concr = Concr {
- flags :: Map CId String, -- value of a flag
- lins :: Map CId Term, -- lin of a fun
- opers :: Map CId Term, -- oper generated by subex elim
- lincats :: Map CId Term, -- lin type of a cat
- lindefs :: Map CId Term, -- lin default of a cat
- printnames :: Map CId Term -- printname of a cat or a fun
- }
-```
-These definitions are from [``GF/GFCC/DataGFCC.hs`` ../DataGFCC.hs].
-
-Identifiers (``CId``) are like ``Ident`` in GF, except that
-the compiler produces constants prefixed with ``_`` in
-the common subterm elimination optimization.
-```
- token CId (('_' | letter) (letter | digit | '\'' | '_')*) ;
-```
-
-
-===Abstract syntax===
-
-Types are first-order function types built from argument type
-contexts and value types.
-category symbols. Syntax trees (``Exp``) are
-rose trees with nodes consisting of a head (``Atom``) and
-bound variables (``CId``).
-```
- DTyp. Type ::= "[" [Hypo] "]" CId [Exp] ;
- DTr. Exp ::= "[" "(" [CId] ")" Atom [Exp] "]" ;
- Hyp. Hypo ::= CId ":" Type ;
-```
-The head Atom is either a function
-constant, a bound variable, or a metavariable, or a string, integer, or float
-literal.
-```
- AC. Atom ::= CId ;
- AS. Atom ::= String ;
- AI. Atom ::= Integer ;
- AF. Atom ::= Double ;
- AM. Atom ::= "?" Integer ;
-```
-The context-free types and trees of the "old GFCC" are special
-cases, which can be defined as follows:
-```
- Typ. Type ::= [CId] "->" CId
- Typ args val = DTyp [Hyp (CId "_") arg | arg <- args] val
-
- Tr. Exp ::= "(" CId [Exp] ")"
- Tr fun exps = DTr [] fun exps
-```
-To store semantic (``def``) definitions by cases, the following expression
-form is provided, but it is only meaningful in the last field of a function
-declaration in an abstract syntax:
-```
- EEq. Exp ::= "{" [Equation] "}" ;
- Equ. Equation ::= [Exp] "->" Exp ;
-```
-Notice that expressions are used to encode patterns. Primitive notions
-(the default semantics in GF) are encoded as empty sets of equations
-(``[]``). For a constructor (canonical form) of a category ``C``, we
-aim to use the encoding as the application ``(_constr C)``.
-
-
-
-===Concrete syntax===
-
-Linearization terms (``Term``) are built as follows.
-Constructor names are shown to make the later code
-examples readable.
-```
- R. Term ::= "[" [Term] "]" ; -- array (record/table)
- P. Term ::= "(" Term "!" Term ")" ; -- access to field (projection/selection)
- S. Term ::= "(" [Term] ")" ; -- concatenated sequence
- K. Term ::= Tokn ; -- token
- V. Term ::= "$" Integer ; -- argument (subtree)
- C. Term ::= Integer ; -- array index (label/parameter value)
- FV. Term ::= "[|" [Term] "|]" ; -- free variation
- TM. Term ::= "?" ; -- linearization of metavariable
-```
-Tokens are strings or (maybe obsolescent) prefix-dependent
-variant lists.
-```
- KS. Tokn ::= String ;
- KP. Tokn ::= "[" "pre" [String] "[" [Variant] "]" "]" ;
- Var. Variant ::= [String] "/" [String] ;
-```
-Two special forms of terms are introduced by the compiler
-as optimizations. They can in principle be eliminated, but
-their presence makes grammars much more compact. Their semantics
-will be explained in a later section.
-```
- F. Term ::= CId ; -- global constant
- W. Term ::= "(" String "+" Term ")" ; -- prefix + suffix table
-```
-There is also a deprecated form of "record parameter alias",
-```
- RP. Term ::= "(" Term "@" Term ")"; -- DEPRECATED
-```
-which will be removed when the migration to new GFCC is complete.
-
-
-
-==The semantics of concrete syntax terms==
-
-The code in this section is from [``GF/GFCC/Linearize.hs`` ../Linearize.hs].
-
-
-===Linearization and realization===
-
-The linearization algorithm is essentially the same as in
-GFC: a tree is linearized by evaluating its linearization term
-in the environment of the linearizations of the subtrees.
-Literal atoms are linearized in the obvious way.
-The function also needs to know the language (i.e. concrete syntax)
-in which linearization is performed.
-```
- linExp :: GFCC -> CId -> Exp -> Term
- linExp gfcc lang tree@(DTr _ at trees) = case at of
- AC fun -> comp (Prelude.map lin trees) $ look fun
- AS s -> R [kks (show s)] -- quoted
- AI i -> R [kks (show i)]
- AF d -> R [kks (show d)]
- AM -> TM
- where
- lin = linExp gfcc lang
- comp = compute gfcc lang
- look = lookLin gfcc lang
-```
-TODO: bindings must be supported.
-
-The result of linearization is usually a record, which is realized as
-a string using the following algorithm.
-```
- realize :: Term -> String
- realize trm = case trm of
- R (t:_) -> realize t
- S ss -> unwords $ Prelude.map realize ss
- K (KS s) -> s
- K (KP s _) -> unwords s ---- prefix choice TODO
- W s t -> s ++ realize t
- FV (t:_) -> realize t
- TM -> "?"
-```
-Notice that realization always picks the first field of a record.
-If a linearization type has more than one field, the first field
-does not necessarily contain the desired string.
-Also notice that the order of record fields in GFCC is not necessarily
-the same as in GF source.
-
-
-===Term evaluation===
-
-Evaluation follows call-by-value order, with two environments
-needed:
-- the grammar (a concrete syntax) to give the global constants
-- an array of terms to give the subtree linearizations
-
-
-The code is presented in one-level pattern matching, to
-enable reimplementations in languages that do not permit
-deep patterns (such as Java and C++).
-```
-compute :: GFCC -> CId -> [Term] -> Term -> Term
-compute gfcc lang args = comp where
- comp trm = case trm of
- P r p -> proj (comp r) (comp p)
- W s t -> W s (comp t)
- R ts -> R $ Prelude.map comp ts
- V i -> idx args (fromInteger i) -- already computed
- F c -> comp $ look c -- not computed (if contains V)
- FV ts -> FV $ Prelude.map comp ts
- S ts -> S $ Prelude.filter (/= S []) $ Prelude.map comp ts
- _ -> trm
-
- look = lookOper gfcc lang
-
- idx xs i = xs !! i
-
- proj r p = case (r,p) of
- (_, FV ts) -> FV $ Prelude.map (proj r) ts
- (FV ts, _ ) -> FV $ Prelude.map (\t -> proj t p) ts
- (W s t, _) -> kks (s ++ getString (proj t p))
- _ -> comp $ getField r (getIndex p)
-
- getString t = case t of
- K (KS s) -> s
- _ -> trace ("ERROR in grammar compiler: string from "++ show t) "ERR"
-
- getIndex t = case t of
- C i -> fromInteger i
- RP p _ -> getIndex p
- TM -> 0 -- default value for parameter
- _ -> trace ("ERROR in grammar compiler: index from " ++ show t) 0
-
- getField t i = case t of
- R rs -> idx rs i
- RP _ r -> getField r i
- TM -> TM
- _ -> trace ("ERROR in grammar compiler: field from " ++ show t) t
-```
-
-===The special term constructors===
-
-The three forms introduced by the compiler may a need special
-explanation.
-
-Global constants
-```
- Term ::= CId ;
-```
-are shorthands for complex terms. They are produced by the
-compiler by (iterated) **common subexpression elimination**.
-They are often more powerful than hand-devised code sharing in the source
-code. They could be computed off-line by replacing each identifier by
-its definition.
-
-**Prefix-suffix tables**
-```
- Term ::= "(" String "+" Term ")" ;
-```
-represent tables of word forms divided to the longest common prefix
-and its array of suffixes. In the example grammar above, we have
-```
- Sleep = [("sleep" + ["s",""])]
-```
-which in fact is equal to the array of full forms
-```
- ["sleeps", "sleep"]
-```
-The power of this construction comes from the fact that suffix sets
-tend to be repeated in a language, and can therefore be collected
-by common subexpression elimination. It is this technique that
-explains the used syntax rather than the more accurate
-```
- "(" String "+" [String] ")"
-```
-since we want the suffix part to be a ``Term`` for the optimization to
-take effect.
-
-
-
-==Compiling to GFCC==
-
-Compilation to GFCC is performed by the GF grammar compiler, and
-GFCC interpreters need not know what it does. For grammar writers,
-however, it might be interesting to know what happens to the grammars
-in the process.
-
-The compilation phases are the following
-+ type check and partially evaluate GF source
-+ create a symbol table mapping the GF parameter and record types to
- fixed-size arrays, and parameter values and record labels to integers
-+ traverse the linearization rules replacing parameters and labels by integers
-+ reorganize the created GF grammar so that it has just one abstract syntax
- and one concrete syntax per language
-+ TODO: apply UTF8 encoding to the grammar, if not yet applied (this is told by the
- ``coding`` flag)
-+ translate the GF grammar object to a GFCC grammar object, using a simple
- compositional mapping
-+ perform the word-suffix optimization on GFCC linearization terms
-+ perform subexpression elimination on each concrete syntax module
-+ print out the GFCC code
-
-
-
-
-===Problems in GFCC compilation===
-
-Two major problems had to be solved in compiling GF to GFCC:
-- consistent order of tables and records, to permit the array translation
-- run-time variables in complex parameter values.
-
-
-The current implementation is still experimental and may fail
-to generate correct code. Any errors remaining are likely to be
-related to the two problems just mentioned.
-
-The order problem is solved in slightly different ways for tables and records.
-In both cases, **eta expansion** is used to establish a
-canonical order. Tables are ordered by applying the preorder induced
-by ``param`` definitions. Records are ordered by sorting them by labels.
-This means that
-e.g. the ``s`` field will in general no longer appear as the first
-field, even if it does so in the GF source code. But relying on the
-order of fields in a labelled record would be misplaced anyway.
-
-The canonical form of records is further complicated by lock fields,
-i.e. dummy fields of form ``lock_C = <>``, which are added to grammar
-libraries to force intensionality of linearization types. The problem
-is that the absence of a lock field only generates a warning, not
-an error. Therefore a GF grammar can contain objects of the same
-type with and without a lock field. This problem was solved in GFCC
-generation by just removing all lock fields (defined as fields whose
-type is the empty record type). This has the further advantage of
-(slightly) reducing the grammar size. More importantly, it is safe
-to remove lock fields, because they are never used in computation,
-and because intensional types are only needed in grammars reused
-as libraries, not in grammars used at runtime.
-
-While the order problem is rather bureaucratic in nature, run-time
-variables are an interesting problem. They arise in the presence
-of complex parameter values, created by argument-taking constructors
-and parameter records. To give an example, consider the GF parameter
-type system
-```
- Number = Sg | Pl ;
- Person = P1 | P2 | P3 ;
- Agr = Ag Number Person ;
-```
-The values can be translated to integers in the expected way,
-```
- Sg = 0, Pl = 1
- P1 = 0, P2 = 1, P3 = 2
- Ag Sg P1 = 0, Ag Sg P2 = 1, Ag Sg P3 = 2,
- Ag Pl P1 = 3, Ag Pl P2 = 4, Ag Pl P3 = 5
-```
-However, an argument of ``Agr`` can be a run-time variable, as in
-```
- Ag np.n P3
-```
-This expression must first be translated to a case expression,
-```
- case np.n of {
- 0 => 2 ;
- 1 => 5
- }
-```
-which can then be translated to the GFCC term
-```
- ([2,5] ! ($0 ! $1))
-```
-assuming that the variable ``np`` is the first argument and that its
-``Number`` field is the second in the record.
-
-This transformation of course has to be performed recursively, since
-there can be several run-time variables in a parameter value:
-```
- Ag np.n np.p
-```
-A similar transformation would be possible to deal with the double
-role of parameter records discussed above. Thus the type
-```
- RNP = {n : Number ; p : Person}
-```
-could be uniformly translated into the set ``{0,1,2,3,4,5}``
-as ``Agr`` above. Selections would be simple instances of indexing.
-But any projection from the record should be translated into
-a case expression,
-```
- rnp.n ===>
- case rnp of {
- 0 => 0 ;
- 1 => 0 ;
- 2 => 0 ;
- 3 => 1 ;
- 4 => 1 ;
- 5 => 1
- }
-```
-To avoid the code bloat resulting from this, we have chosen to
-deal with records by a **currying** transformation:
-```
- table {n : Number ; p : Person} {... ...}
- ===>
- table Number {Sg => table Person {...} ; table Person {...}}
-```
-This is performed when GFCC is generated. Selections with
-records have to be treated likewise,
-```
- t ! r ===> t ! r.n ! r.p
-```
-
-
-===The representation of linearization types===
-
-Linearization types (``lincat``) are not needed when generating with
-GFCC, but they have been added to enable parser generation directly from
-GFCC. The linearization type definitions are shown as a part of the
-concrete syntax, by using terms to represent types. Here is the table
-showing how different linearization types are encoded.
-```
- P* = max(P) -- parameter type
- {r1 : T1 ; ... ; rn : Tn}* = [T1*,...,Tn*] -- record
- (P => T)* = [T* ,...,T*] -- table, size(P) cases
- Str* = ()
-```
-For example, the linearization type ``present/CatEng.NP`` is
-translated as follows:
-```
- NP = {
- a : { -- 6 = 2*3 values
- n : {ParamX.Number} ; -- 2 values
- p : {ParamX.Person} -- 3 values
- } ;
- s : {ResEng.Case} => Str -- 3 values
- }
-
- __NP = [[1,2],[(),(),()]]
-```
-
-
-
-
-===Running the compiler and the GFCC interpreter===
-
-GFCC generation is a part of the
-[developers' version http://www.cs.chalmers.se/Cs/Research/Language-technology/darcs/GF/doc/darcs.html]
-of GF since September 2006. To invoke the compiler, the flag
-``-printer=gfcc`` to the command
-``pm = print_multi`` is used. It is wise to recompile the grammar from
-source, since previously compiled libraries may not obey the canonical
-order of records.
-Here is an example, performed in
-[example/bronzeage ../../../../../examples/bronzeage].
-```
- i -src -path=.:prelude:resource-1.0/* -optimize=all_subs BronzeageEng.gf
- i -src -path=.:prelude:resource-1.0/* -optimize=all_subs BronzeageGer.gf
- strip
- pm -printer=gfcc | wf bronze.gfcc
-```
-There is also an experimental batch compiler, which does not use the GFC
-format or the record aliases. It can be produced by
-```
- make gfc
-```
-in ``GF/src``, and invoked by
-```
- gfc --make FILES
-```
-
-
-
-
-==The reference interpreter==
-
-The reference interpreter written in Haskell consists of the following files:
-```
- -- source file for BNFC
- GFCC.cf -- labelled BNF grammar of gfcc
-
- -- files generated by BNFC
- AbsGFCC.hs -- abstrac syntax datatypes
- ErrM.hs -- error monad used internally
- LexGFCC.hs -- lexer of gfcc files
- ParGFCC.hs -- parser of gfcc files and syntax trees
- PrintGFCC.hs -- printer of gfcc files and syntax trees
-
- -- hand-written files
- DataGFCC.hs -- grammar datatype, post-parser grammar creation
- Linearize.hs -- linearization and evaluation
- Macros.hs -- utilities abstracting away from GFCC datatypes
- Generate.hs -- random and exhaustive generation, generate-and-test parsing
- API.hs -- functionalities accessible in embedded GF applications
- Generate.hs -- random and exhaustive generation
- Shell.hs -- main function - a simple command interpreter
-```
-It is included in the
-[developers' version http://www.cs.chalmers.se/Cs/Research/Language-technology/darcs/GF/doc/darcs.html]
-of GF, in the subdirectories [``GF/src/GF/GFCC`` ../] and
-[``GF/src/GF/Devel`` ../../Devel].
-
-As of September 2007, default parsing in main GF uses GFCC (implemented by Krasimir
-Angelov). The interpreter uses the relevant modules
-```
- GF/Conversions/SimpleToFCFG.hs -- generate parser from GFCC
- GF/Parsing/FCFG.hs -- run the parser
-```
-
-
-To compile the interpreter, type
-```
- make gfcc
-```
-in ``GF/src``. To run it, type
-```
- ./gfcc <GFCC-file>
-```
-The available commands are
-- ``gr <Cat> <Int>``: generate a number of random trees in category.
- and show their linearizations in all languages
-- ``grt <Cat> <Int>``: generate a number of random trees in category.
- and show the trees and their linearizations in all languages
-- ``gt <Cat> <Int>``: generate a number of trees in category from smallest,
- and show their linearizations in all languages
-- ``gtt <Cat> <Int>``: generate a number of trees in category from smallest,
- and show the trees and their linearizations in all languages
-- ``p <Lang> <Cat> <String>``: parse a string into a set of trees
-- ``lin <Tree>``: linearize tree in all languages, also showing full records
-- ``q``: terminate the system cleanly
-
-
-
-==Embedded formats==
-
-- JavaScript: compiler of linearization and abstract syntax
-
-- Haskell: compiler of abstract syntax and interpreter with parsing,
- linearization, and generation
-
-- C: compiler of linearization (old GFCC)
-
-- C++: embedded interpreter supporting linearization (old GFCC)
-
-
-
-==Some things to do==
-
-Support for dependent types, higher-order abstract syntax, and
-semantic definition in GFCC generation and interpreters.
-
-Replacing the entire GF shell by one based on GFCC.
-
-Interpreter in Java.
-
-Hand-written parsers for GFCC grammars to reduce code size
-(and efficiency?) of interpreters.
-
-Binary format and/or file compression of GFCC output.
-
-Syntax editor based on GFCC.
-
-Rewriting of resource libraries in order to exploit the
-word-suffix sharing better (depth-one tables, as in FM).
-
diff --git a/src/PGF/doc/old-GFCC.cf b/src/PGF/doc/old-GFCC.cf
deleted file mode 100644
index 65657a259..000000000
--- a/src/PGF/doc/old-GFCC.cf
+++ /dev/null
@@ -1,50 +0,0 @@
-Grm. Grammar ::= Header ";" Abstract ";" [Concrete] ;
-Hdr. Header ::= "grammar" CId "(" [CId] ")" ;
-Abs. Abstract ::= "abstract" "{" [AbsDef] "}" ;
-Cnc. Concrete ::= "concrete" CId "{" [CncDef] "}" ;
-
-Fun. AbsDef ::= CId ":" Type "=" Exp ;
---AFl. AbsDef ::= "%" CId "=" String ; -- flag
-Lin. CncDef ::= CId "=" Term ;
---CFl. CncDef ::= "%" CId "=" String ; -- flag
-
-Typ. Type ::= [CId] "->" CId ;
-Tr. Exp ::= "(" Atom [Exp] ")" ;
-AC. Atom ::= CId ;
-AS. Atom ::= String ;
-AI. Atom ::= Integer ;
-AF. Atom ::= Double ;
-AM. Atom ::= "?" ;
-trA. Exp ::= Atom ;
-define trA a = Tr a [] ;
-
-R. Term ::= "[" [Term] "]" ; -- record/table
-P. Term ::= "(" Term "!" Term ")" ; -- projection/selection
-S. Term ::= "(" [Term] ")" ; -- sequence with ++
-K. Term ::= Tokn ; -- token
-V. Term ::= "$" Integer ; -- argument
-C. Term ::= Integer ; -- parameter value/label
-F. Term ::= CId ; -- global constant
-FV. Term ::= "[|" [Term] "|]" ; -- free variation
-W. Term ::= "(" String "+" Term ")" ; -- prefix + suffix table
-RP. Term ::= "(" Term "@" Term ")"; -- record parameter alias
-TM. Term ::= "?" ; -- lin of metavariable
-
-L. Term ::= "(" CId "->" Term ")" ; -- lambda abstracted table
-BV. Term ::= "#" CId ; -- lambda-bound variable
-
-KS. Tokn ::= String ;
-KP. Tokn ::= "[" "pre" [String] "[" [Variant] "]" "]" ;
-Var. Variant ::= [String] "/" [String] ;
-
-
-terminator Concrete ";" ;
-terminator AbsDef ";" ;
-terminator CncDef ";" ;
-separator CId "," ;
-separator Term "," ;
-terminator Exp "" ;
-terminator String "" ;
-separator Variant "," ;
-
-token CId (('_' | letter) (letter | digit | '\'' | '_')*) ;
diff --git a/src/PGF/doc/old-gfcc.txt b/src/PGF/doc/old-gfcc.txt
deleted file mode 100644
index 6ffd9bd64..000000000
--- a/src/PGF/doc/old-gfcc.txt
+++ /dev/null
@@ -1,656 +0,0 @@
-The GFCC Grammar Format
-Aarne Ranta
-October 19, 2006
-
-Author's address:
-[``http://www.cs.chalmers.se/~aarne`` http://www.cs.chalmers.se/~aarne]
-
-% to compile: txt2tags -thtml --toc gfcc.txt
-
-History:
-- 19 Oct: translation of lincats, new figures on C++
-- 3 Oct 2006: first version
-
-
-==What is GFCC==
-
-GFCC is a low-level format for GF grammars. Its aim is to contain the minimum
-that is needed to process GF grammars at runtime. This minimality has three
-advantages:
-- compact grammar files and run-time objects
-- time and space efficient processing
-- simple definition of interpreters
-
-
-The idea is that all embedded GF applications are compiled to GFCC.
-The GF system would be primarily used as a compiler and as a grammar
-development tool.
-
-Since GFCC is implemented in BNFC, a parser of the format is readily
-available for C, C++, Haskell, Java, and OCaml. Also an XML
-representation is generated in BNFC. A
-[reference implementation ../]
-of linearization and some other functions has been written in Haskell.
-
-
-==GFCC vs. GFC==
-
-GFCC is aimed to replace GFC as the run-time grammar format. GFC was designed
-to be a run-time format, but also to
-support separate compilation of grammars, i.e.
-to store the results of compiling
-individual GF modules. But this means that GFC has to contain extra information,
-such as type annotations, which is only needed in compilation and not at
-run-time. In particular, the pattern matching syntax and semantics of GFC is
-complex and therefore difficult to implement in new platforms.
-
-The main differences of GFCC compared with GFC can be summarized as follows:
-- there are no modules, and therefore no qualified names
-- a GFCC grammar is multilingual, and consists of a common abstract syntax
- together with one concrete syntax per language
-- records and tables are replaced by arrays
-- record labels and parameter values are replaced by integers
-- record projection and table selection are replaced by array indexing
-- there is (so far) no support for dependent types or higher-order abstract
- syntax (which would be easy to add, but make interpreters much more difficult
- to write)
-
-
-Here is an example of a GF grammar, consisting of three modules,
-as translated to GFCC. The representations are aligned, with the exceptions
-due to the alphabetical sorting of GFCC grammars.
-```
- grammar Ex(Eng,Swe);
-
-abstract Ex = { abstract {
- cat
- S ; NP ; VP ;
- fun
- Pred : NP -> VP -> S ; Pred : NP,VP -> S = (Pred);
- She, They : NP ; She : -> NP = (She);
- Sleep : VP ; Sleep : -> VP = (Sleep);
- They : -> NP = (They);
-} } ;
-
-concrete Eng of Ex = { concrete Eng {
- lincat
- S = {s : Str} ;
- NP = {s : Str ; n : Num} ;
- VP = {s : Num => Str} ;
- param
- Num = Sg | Pl ;
- lin
- Pred np vp = { Pred = [(($0!1),(($1!0)!($0!0)))];
- s = np.s ++ vp.s ! np.n} ;
- She = {s = "she" ; n = Sg} ; She = [0, "she"];
- They = {s = "they" ; n = Pl} ;
- Sleep = {s = table { Sleep = [("sleep" + ["s",""])];
- Sg => "sleeps" ;
- Pl => "sleep" They = [1, "they"];
- } } ;
- } ;
-}
-
-concrete Swe of Ex = { concrete Swe {
- lincat
- S = {s : Str} ;
- NP = {s : Str} ;
- VP = {s : Str} ;
- param
- Num = Sg | Pl ;
- lin
- Pred np vp = { Pred = [(($0!0),($1!0))];
- s = np.s ++ vp.s} ;
- She = {s = "hon"} ; She = ["hon"];
- They = {s = "de"} ; They = ["de"];
- Sleep = {s = "sover"} ; Sleep = ["sover"];
-} } ;
-```
-
-==The syntax of GFCC files==
-
-===Top level===
-
-A grammar has a header telling the name of the abstract syntax
-(often specifying an application domain), and the names of
-the concrete languages. The abstract syntax and the concrete
-syntaxes themselves follow.
-```
- Grammar ::= Header ";" Abstract ";" [Concrete] ;
- Header ::= "grammar" CId "(" [CId] ")" ;
- Abstract ::= "abstract" "{" [AbsDef] "}" ;
- Concrete ::= "concrete" CId "{" [CncDef] "}" ;
-```
-Abstract syntax judgements give typings and semantic definitions.
-Concrete syntax judgements give linearizations.
-```
- AbsDef ::= CId ":" Type "=" Exp ;
- CncDef ::= CId "=" Term ;
-```
-Also flags are possible, local to each "module" (i.e. abstract and concretes).
-```
- AbsDef ::= "%" CId "=" String ;
- CncDef ::= "%" CId "=" String ;
-```
-For the run-time system, the reference implementation in Haskell
-uses a structure that gives efficient look-up:
-```
- data GFCC = GFCC {
- absname :: CId ,
- cncnames :: [CId] ,
- abstract :: Abstr ,
- concretes :: Map CId Concr
- }
-
- data Abstr = Abstr {
- funs :: Map CId Type, -- find the type of a fun
- cats :: Map CId [CId] -- find the funs giving a cat
- }
-
- type Concr = Map CId Term
-```
-
-
-===Abstract syntax===
-
-Types are first-order function types built from
-category symbols. Syntax trees (``Exp``) are
-rose trees with the head (``Atom``) either a function
-constant, a metavariable, or a string, integer, or float
-literal.
-```
- Type ::= [CId] "->" CId ;
- Exp ::= "(" Atom [Exp] ")" ;
- Atom ::= CId ; -- function constant
- Atom ::= "?" ; -- metavariable
- Atom ::= String ; -- string literal
- Atom ::= Integer ; -- integer literal
- Atom ::= Double ; -- float literal
-```
-
-
-===Concrete syntax===
-
-Linearization terms (``Term``) are built as follows.
-Constructor names are shown to make the later code
-examples readable.
-```
- R. Term ::= "[" [Term] "]" ; -- array
- P. Term ::= "(" Term "!" Term ")" ; -- access to indexed field
- S. Term ::= "(" [Term] ")" ; -- sequence with ++
- K. Term ::= Tokn ; -- token
- V. Term ::= "$" Integer ; -- argument
- C. Term ::= Integer ; -- array index
- FV. Term ::= "[|" [Term] "|]" ; -- free variation
- TM. Term ::= "?" ; -- linearization of metavariable
-```
-Tokens are strings or (maybe obsolescent) prefix-dependent
-variant lists.
-```
- KS. Tokn ::= String ;
- KP. Tokn ::= "[" "pre" [String] "[" [Variant] "]" "]" ;
- Var. Variant ::= [String] "/" [String] ;
-```
-Three special forms of terms are introduced by the compiler
-as optimizations. They can in principle be eliminated, but
-their presence makes grammars much more compact. Their semantics
-will be explained in a later section.
-```
- F. Term ::= CId ; -- global constant
- W. Term ::= "(" String "+" Term ")" ; -- prefix + suffix table
- RP. Term ::= "(" Term "@" Term ")"; -- record parameter alias
-```
-Identifiers are like ``Ident`` in GF and GFC, except that
-the compiler produces constants prefixed with ``_`` in
-the common subterm elimination optimization.
-```
- token CId (('_' | letter) (letter | digit | '\'' | '_')*) ;
-```
-
-
-==The semantics of concrete syntax terms==
-
-===Linearization and realization===
-
-The linearization algorithm is essentially the same as in
-GFC: a tree is linearized by evaluating its linearization term
-in the environment of the linearizations of the subtrees.
-Literal atoms are linearized in the obvious way.
-The function also needs to know the language (i.e. concrete syntax)
-in which linearization is performed.
-```
- linExp :: GFCC -> CId -> Exp -> Term
- linExp mcfg lang tree@(Tr at trees) = case at of
- AC fun -> comp (Prelude.map lin trees) $ look fun
- AS s -> R [kks (show s)] -- quoted
- AI i -> R [kks (show i)]
- AF d -> R [kks (show d)]
- AM -> TM
- where
- lin = linExp mcfg lang
- comp = compute mcfg lang
- look = lookLin mcfg lang
-```
-The result of linearization is usually a record, which is realized as
-a string using the following algorithm.
-```
- realize :: Term -> String
- realize trm = case trm of
- R (t:_) -> realize t
- S ss -> unwords $ Prelude.map realize ss
- K (KS s) -> s
- K (KP s _) -> unwords s ---- prefix choice TODO
- W s t -> s ++ realize t
- FV (t:_) -> realize t
- TM -> "?"
-```
-Since the order of record fields is not necessarily
-the same as in GF source,
-this realization does not work securely for
-categories whose lincats more than one field.
-
-
-===Term evaluation===
-
-Evaluation follows call-by-value order, with two environments
-needed:
-- the grammar (a concrete syntax) to give the global constants
-- an array of terms to give the subtree linearizations
-
-
-The code is presented in one-level pattern matching, to
-enable reimplementations in languages that do not permit
-deep patterns (such as Java and C++).
-```
-compute :: GFCC -> CId -> [Term] -> Term -> Term
-compute mcfg lang args = comp where
- comp trm = case trm of
- P r p -> proj (comp r) (comp p)
- RP i t -> RP (comp i) (comp t)
- W s t -> W s (comp t)
- R ts -> R $ Prelude.map comp ts
- V i -> idx args (fromInteger i) -- already computed
- F c -> comp $ look c -- not computed (if contains V)
- FV ts -> FV $ Prelude.map comp ts
- S ts -> S $ Prelude.filter (/= S []) $ Prelude.map comp ts
- _ -> trm
-
- look = lookLin mcfg lang
-
- idx xs i = xs !! i
-
- proj r p = case (r,p) of
- (_, FV ts) -> FV $ Prelude.map (proj r) ts
- (W s t, _) -> kks (s ++ getString (proj t p))
- _ -> comp $ getField r (getIndex p)
-
- getString t = case t of
- K (KS s) -> s
- _ -> trace ("ERROR in grammar compiler: string from "++ show t) "ERR"
-
- getIndex t = case t of
- C i -> fromInteger i
- RP p _ -> getIndex p
- TM -> 0 -- default value for parameter
- _ -> trace ("ERROR in grammar compiler: index from " ++ show t) 0
-
- getField t i = case t of
- R rs -> idx rs i
- RP _ r -> getField r i
- TM -> TM
- _ -> trace ("ERROR in grammar compiler: field from " ++ show t) t
-```
-
-===The special term constructors===
-
-The three forms introduced by the compiler may a need special
-explanation.
-
-Global constants
-```
- Term ::= CId ;
-```
-are shorthands for complex terms. They are produced by the
-compiler by (iterated) common subexpression elimination.
-They are often more powerful than hand-devised code sharing in the source
-code. They could be computed off-line by replacing each identifier by
-its definition.
-
-Prefix-suffix tables
-```
- Term ::= "(" String "+" Term ")" ;
-```
-represent tables of word forms divided to the longest common prefix
-and its array of suffixes. In the example grammar above, we have
-```
- Sleep = [("sleep" + ["s",""])]
-```
-which in fact is equal to the array of full forms
-```
- ["sleeps", "sleep"]
-```
-The power of this construction comes from the fact that suffix sets
-tend to be repeated in a language, and can therefore be collected
-by common subexpression elimination. It is this technique that
-explains the used syntax rather than the more accurate
-```
- "(" String "+" [String] ")"
-```
-since we want the suffix part to be a ``Term`` for the optimization to
-take effect.
-
-The most curious construct of GFCC is the parameter array alias,
-```
- Term ::= "(" Term "@" Term ")";
-```
-This form is used as the value of parameter records, such as the type
-```
- {n : Number ; p : Person}
-```
-The problem with parameter records is their double role.
-They can be used like parameter values, as indices in selection,
-```
- VP.s ! {n = Sg ; p = P3}
-```
-but also as records, from which parameters can be projected:
-```
- {n = Sg ; p = P3}.n
-```
-Whichever use is selected as primary, a prohibitively complex
-case expression must be generated at compilation to GFCC to get the
-other use. The adopted
-solution is to generate a pair containing both a parameter value index
-and an array of indices of record fields. For instance, if we have
-```
- param Number = Sg | Pl ; Person = P1 | P2 | P3 ;
-```
-we get the encoding
-```
- {n = Sg ; p = P3} ---> (2 @ [0,2])
-```
-The GFCC computation rules are essentially
-```
- (t ! (i @ _)) = (t ! i)
- ((_ @ r) ! j) =(r ! j)
-```
-
-
-==Compiling to GFCC==
-
-Compilation to GFCC is performed by the GF grammar compiler, and
-GFCC interpreters need not know what it does. For grammar writers,
-however, it might be interesting to know what happens to the grammars
-in the process.
-
-The compilation phases are the following
-+ translate GF source to GFC, as always in GF
-+ undo GFC back-end optimizations
-+ perform the ``values`` optimization to normalize tables
-+ create a symbol table mapping the GFC parameter and record types to
- fixed-size arrays, and parameter values and record labels to integers
-+ traverse the linearization rules replacing parameters and labels by integers
-+ reorganize the created GFC grammar so that it has just one abstract syntax
- and one concrete syntax per language
-+ apply UTF8 encoding to the grammar, if not yet applied (this is told by the
- ``coding`` flag)
-+ translate the GFC syntax tree to a GFCC syntax tree, using a simple
- compositional mapping
-+ perform the word-suffix optimization on GFCC linearization terms
-+ perform subexpression elimination on each concrete syntax module
-+ print out the GFCC code
-
-
-Notice that a major part of the compilation is done within GFC, so that
-GFC-related tasks (such as parser generation) could be performed by
-using the old algorithms.
-
-
-===Problems in GFCC compilation===
-
-Two major problems had to be solved in compiling GFC to GFCC:
-- consistent order of tables and records, to permit the array translation
-- run-time variables in complex parameter values.
-
-
-The current implementation is still experimental and may fail
-to generate correct code. Any errors remaining are likely to be
-related to the two problems just mentioned.
-
-The order problem is solved in different ways for tables and records.
-For tables, the ``values`` optimization of GFC already manages to
-maintain a canonical order. But this order can be destroyed by the
-``share`` optimization. To make sure that GFCC compilation works properly,
-it is safest to recompile the GF grammar by using the ``values``
-optimization flag.
-
-Records can be canonically ordered by sorting them by labels.
-In fact, this was done in connection of the GFCC work as a part
-of the GFC generation, to guarantee consistency. This means that
-e.g. the ``s`` field will in general no longer appear as the first
-field, even if it does so in the GF source code. But relying on the
-order of fields in a labelled record would be misplaced anyway.
-
-The canonical form of records is further complicated by lock fields,
-i.e. dummy fields of form ``lock_C = <>``, which are added to grammar
-libraries to force intensionality of linearization types. The problem
-is that the absence of a lock field only generates a warning, not
-an error. Therefore a GFC grammar can contain objects of the same
-type with and without a lock field. This problem was solved in GFCC
-generation by just removing all lock fields (defined as fields whose
-type is the empty record type). This has the further advantage of
-(slightly) reducing the grammar size. More importantly, it is safe
-to remove lock fields, because they are never used in computation,
-and because intensional types are only needed in grammars reused
-as libraries, not in grammars used at runtime.
-
-While the order problem is rather bureaucratic in nature, run-time
-variables are an interesting problem. They arise in the presence
-of complex parameter values, created by argument-taking constructors
-and parameter records. To give an example, consider the GF parameter
-type system
-```
- Number = Sg | Pl ;
- Person = P1 | P2 | P3 ;
- Agr = Ag Number Person ;
-```
-The values can be translated to integers in the expected way,
-```
- Sg = 0, Pl = 1
- P1 = 0, P2 = 1, P3 = 2
- Ag Sg P1 = 0, Ag Sg P2 = 1, Ag Sg P3 = 2,
- Ag Pl P1 = 3, Ag Pl P2 = 4, Ag Pl P3 = 5
-```
-However, an argument of ``Agr`` can be a run-time variable, as in
-```
- Ag np.n P3
-```
-This expression must first be translated to a case expression,
-```
- case np.n of {
- 0 => 2 ;
- 1 => 5
- }
-```
-which can then be translated to the GFCC term
-```
- ([2,5] ! ($0 ! $1))
-```
-assuming that the variable ``np`` is the first argument and that its
-``Number`` field is the second in the record.
-
-This transformation of course has to be performed recursively, since
-there can be several run-time variables in a parameter value:
-```
- Ag np.n np.p
-```
-A similar transformation would be possible to deal with the double
-role of parameter records discussed above. Thus the type
-```
- RNP = {n : Number ; p : Person}
-```
-could be uniformly translated into the set ``{0,1,2,3,4,5}``
-as ``Agr`` above. Selections would be simple instances of indexing.
-But any projection from the record should be translated into
-a case expression,
-```
- rnp.n ===>
- case rnp of {
- 0 => 0 ;
- 1 => 0 ;
- 2 => 0 ;
- 3 => 1 ;
- 4 => 1 ;
- 5 => 1
- }
-```
-To avoid the code bloat resulting from this, we chose the alias representation
-which is easy enough to deal with in interpreters.
-
-
-===The representation of linearization types===
-
-Linearization types (``lincat``) are not needed when generating with
-GFCC, but they have been added to enable parser generation directly from
-GFCC. The linearization type definitions are shown as a part of the
-concrete syntax, by using terms to represent types. Here is the table
-showing how different linearization types are encoded.
-```
- P* = size(P) -- parameter type
- {_ : I ; __ : R}* = (I* @ R*) -- record of parameters
- {r1 : T1 ; ... ; rn : Tn}* = [T1*,...,Tn*] -- other record
- (P => T)* = [T* ,...,T*] -- size(P) times
- Str* = ()
-```
-The category symbols are prefixed with two underscores (``__``).
-For example, the linearization type ``present/CatEng.NP`` is
-translated as follows:
-```
- NP = {
- a : { -- 6 = 2*3 values
- n : {ParamX.Number} ; -- 2 values
- p : {ParamX.Person} -- 3 values
- } ;
- s : {ResEng.Case} => Str -- 3 values
- }
-
- __NP = [(6@[2,3]),[(),(),()]]
-```
-
-
-
-
-===Running the compiler and the GFCC interpreter===
-
-GFCC generation is a part of the
-[developers' version http://www.cs.chalmers.se/Cs/Research/Language-technology/darcs/GF/doc/darcs.html]
-of GF since September 2006. To invoke the compiler, the flag
-``-printer=gfcc`` to the command
-``pm = print_multi`` is used. It is wise to recompile the grammar from
-source, since previously compiled libraries may not obey the canonical
-order of records. To ``strip`` the grammar before
-GFCC translation removes unnecessary interface references.
-Here is an example, performed in
-[example/bronzeage ../../../../../examples/bronzeage].
-```
- i -src -path=.:prelude:resource-1.0/* -optimize=all_subs BronzeageEng.gf
- i -src -path=.:prelude:resource-1.0/* -optimize=all_subs BronzeageGer.gf
- strip
- pm -printer=gfcc | wf bronze.gfcc
-```
-
-
-
-==The reference interpreter==
-
-The reference interpreter written in Haskell consists of the following files:
-```
- -- source file for BNFC
- GFCC.cf -- labelled BNF grammar of gfcc
-
- -- files generated by BNFC
- AbsGFCC.hs -- abstrac syntax of gfcc
- ErrM.hs -- error monad used internally
- LexGFCC.hs -- lexer of gfcc files
- ParGFCC.hs -- parser of gfcc files and syntax trees
- PrintGFCC.hs -- printer of gfcc files and syntax trees
-
- -- hand-written files
- DataGFCC.hs -- post-parser grammar creation, linearization and evaluation
- GenGFCC.hs -- random and exhaustive generation, generate-and-test parsing
- RunGFCC.hs -- main function - a simple command interpreter
-```
-It is included in the
-[developers' version http://www.cs.chalmers.se/Cs/Research/Language-technology/darcs/GF/doc/darcs.html]
-of GF, in the subdirectory [``GF/src/GF/Canon/GFCC`` ../].
-
-To compile the interpreter, type
-```
- make gfcc
-```
-in ``GF/src``. To run it, type
-```
- ./gfcc <GFCC-file>
-```
-The available commands are
-- ``gr <Cat> <Int>``: generate a number of random trees in category.
- and show their linearizations in all languages
-- ``grt <Cat> <Int>``: generate a number of random trees in category.
- and show the trees and their linearizations in all languages
-- ``gt <Cat> <Int>``: generate a number of trees in category from smallest,
- and show their linearizations in all languages
-- ``gtt <Cat> <Int>``: generate a number of trees in category from smallest,
- and show the trees and their linearizations in all languages
-- ``p <Int> <Cat> <String>``: "parse", i.e. generate trees until match or
- until the given number have been generated
-- ``<Tree>``: linearize tree in all languages, also showing full records
-- ``quit``: terminate the system cleanly
-
-
-==Interpreter in C++==
-
-A base-line interpreter in C++ has been started.
-Its main functionality is random generation of trees and linearization of them.
-
-Here are some results from running the different interpreters, compared
-to running the same grammar in GF, saved in ``.gfcm`` format.
-The grammar contains the English, German, and Norwegian
-versions of Bronzeage. The experiment was carried out on
-Ubuntu Linux laptop with 1.5 GHz Intel centrino processor.
-
-|| | GF | gfcc(hs) | gfcc++ |
-| program size | 7249k | 803k | 113k
-| grammar size | 336k | 119k | 119k
-| read grammar | 1150ms | 510ms | 100ms
-| generate 222 | 9500ms | 450ms | 800ms
-| memory | 21M | 10M | 20M
-
-
-
-To summarize:
-- going from GF to gfcc is a major win in both code size and efficiency
-- going from Haskell to C++ interpreter is not a win yet, because of a space
- leak in the C++ version
-
-
-
-==Some things to do==
-
-Interpreter in Java.
-
-Parsing via MCFG
-- the FCFG format can possibly be simplified
-- parser grammars should be saved in files to make interpreters easier
-
-
-Hand-written parsers for GFCC grammars to reduce code size
-(and efficiency?) of interpreters.
-
-Binary format and/or file compression of GFCC output.
-
-Syntax editor based on GFCC.
-
-Rewriting of resource libraries in order to exploit the
-word-suffix sharing better (depth-one tables, as in FM).
-
-
-
diff --git a/src/PGF/doc/syntax.txt b/src/PGF/doc/syntax.txt
deleted file mode 100644
index db8f7c149..000000000
--- a/src/PGF/doc/syntax.txt
+++ /dev/null
@@ -1,180 +0,0 @@
-GFCC Syntax
-
-
-==Syntax of GFCC files==
-
-The parser syntax is very simple, as defined in BNF:
-```
- Grm. Grammar ::= [RExp] ;
-
- App. RExp ::= "(" CId [RExp] ")" ;
- AId. RExp ::= CId ;
- AInt. RExp ::= Integer ;
- AStr. RExp ::= String ;
- AFlt. RExp ::= Double ;
- AMet. RExp ::= "?" ;
-
- terminator RExp "" ;
-
- token CId (('_' | letter) (letter | digit | '\'' | '_')*) ;
-```
-While a parser and a printer can be generated for many languages
-from this grammar by using the BNF Converter, a parser is also
-easy to write by hand using recursive descent.
-
-
-==Syntax of well-formed GFCC code==
-
-Here is a summary of well-formed syntax,
-with a comment on the semantics of each construction.
-```
- Grammar ::=
- ("grammar" CId CId*) -- abstract syntax name and concrete syntax names
- "(" "flags" Flag* ")" -- global and abstract flags
- "(" "abstract" Abstract ")" -- abstract syntax
- "(" "concrete" Concrete* ")" -- concrete syntaxes
-
- Abstract ::=
- "(" "fun" FunDef* ")" -- function definitions
- "(" "cat" CatDef* ")" -- category definitions
-
- Concrete ::=
- "(" CId -- language name
- "flags" Flag* -- concrete flags
- "lin" LinDef* -- linearization rules
- "oper" LinDef* -- operations (macros)
- "lincat" LinDef* -- linearization type definitions
- "lindef" LinDef* -- linearization default definitions
- "printname" LinDef* -- printname definitions
- "param" LinDef* -- lincats with labels and parameter value names
- ")"
-
- Flag ::= "(" CId String ")" -- flag and value
- FunDef ::= "(" CId Type Exp ")" -- function, type, and definition
- CatDef ::= "(" CId Hypo* ")" -- category and context
- LinDef ::= "(" CId Term ")" -- function and definition
-
- Type ::=
- "(" CId -- value category
- "(" "H" Hypo* ")" -- argument context
- "(" "X" Exp* ")" ")" -- arguments (of dependent value type)
-
- Exp ::=
- "(" CId -- function
- "(" "B" CId* ")" -- bindings
- "(" "X" Exp* ")" ")" -- arguments
- | CId -- variable
- | "?" -- metavariable
- | "(" "Eq" Equation* ")" -- group of pattern equations
- | Integer -- integer literal (non-negative)
- | Float -- floating-point literal (non-negative)
- | String -- string literal (in double quotes)
-
- Hypo ::= "(" CId Type ")" -- variable and type
-
- Equation ::= "(" "E" Exp Exp* ")" -- value and pattern list
-
- Term ::=
- "(" "R" Term* ")" -- array (record or table)
- | "(" "S" Term* ")" -- concatenated sequence
- | "(" "FV" Term* ")" -- free variant list
- | "(" "P" Term Term ")" -- access to index (projection or selection)
- | "(" "W" String Term ")" -- token prefix with suffix list
- | "(" "A" Integer ")" -- pointer to subtree
- | String -- token (in double quotes)
- | Integer -- index in array
- | CId -- macro constant
- | "?" -- metavariable
-```
-
-
-==GFCC interpreter==
-
-The first phase in interpreting GFCC is to parse a GFCC file and
-build an internal abstract syntax representation, as specified
-in the previous section.
-
-With this representation, linearization can be performed by
-a straightforward function from expressions (``Exp``) to terms
-(``Term``). All expressions except groups of pattern equations
-can be linearized.
-
-Here is a reference Haskell implementation of linearization:
-```
- linExp :: GFCC -> CId -> Exp -> Term
- linExp gfcc lang tree@(DTr _ at trees) = case at of
- AC fun -> comp (map lin trees) $ look fun
- AS s -> R [K (show s)] -- quoted
- AI i -> R [K (show i)]
- AF d -> R [K (show d)]
- AM -> TM
- where
- lin = linExp gfcc lang
- comp = compute gfcc lang
- look = lookLin gfcc lang
-```
-TODO: bindings must be supported.
-
-Terms resulting from linearization are evaluated in
-call-by-value order, with two environments needed:
-- the grammar (a concrete syntax) to give the global constants
-- an array of terms to give the subtree linearizations
-
-
-The Haskell implementation works as follows:
-```
-compute :: GFCC -> CId -> [Term] -> Term -> Term
-compute gfcc lang args = comp where
- comp trm = case trm of
- P r p -> proj (comp r) (comp p)
- W s t -> W s (comp t)
- R ts -> R $ map comp ts
- V i -> idx args (fromInteger i) -- already computed
- F c -> comp $ look c -- not computed (if contains V)
- FV ts -> FV $ Prelude.map comp ts
- S ts -> S $ Prelude.filter (/= S []) $ Prelude.map comp ts
- _ -> trm
-
- look = lookOper gfcc lang
-
- idx xs i = xs !! i
-
- proj r p = case (r,p) of
- (_, FV ts) -> FV $ Prelude.map (proj r) ts
- (FV ts, _ ) -> FV $ Prelude.map (\t -> proj t p) ts
- (W s t, _) -> kks (s ++ getString (proj t p))
- _ -> comp $ getField r (getIndex p)
-
- getString t = case t of
- K (KS s) -> s
- _ -> trace ("ERROR in grammar compiler: string from "++ show t) "ERR"
-
- getIndex t = case t of
- C i -> fromInteger i
- RP p _ -> getIndex p
- TM -> 0 -- default value for parameter
- _ -> trace ("ERROR in grammar compiler: index from " ++ show t) 0
-
- getField t i = case t of
- R rs -> idx rs i
- RP _ r -> getField r i
- TM -> TM
- _ -> trace ("ERROR in grammar compiler: field from " ++ show t) t
-```
-The result of linearization is usually a record, which is realized as
-a string using the following algorithm.
-```
- realize :: Term -> String
- realize trm = case trm of
- R (t:_) -> realize t
- S ss -> unwords $ map realize ss
- K s -> s
- W s t -> s ++ realize t
- FV (t:_) -> realize t -- TODO: all variants
- TM -> "?"
-```
-Notice that realization always picks the first field of a record.
-If a linearization type has more than one field, the first field
-does not necessarily contain the desired string.
-Also notice that the order of record fields in GFCC is not necessarily
-the same as in GF source.
diff --git a/src/ReleaseProcedure b/src/ReleaseProcedure
deleted file mode 100644
index c04f2a065..000000000
--- a/src/ReleaseProcedure
+++ /dev/null
@@ -1,153 +0,0 @@
-Procedure for making a GF release:
-
-1. Make sure everything that should be in the release has been
- checked in.
-
-2. Go to the src/ dir.
-
- $ cd src
-
-3. Edit configure.ac to set the right version number
- (the second argument to the AC_INIT macro).
-
-4. Edit gf.spec to set the version and release numbers
- (change %define version and %define release).
-
-5. Commit configure.ac and gf.spec:
-
- $ darcs record -m 'Updated version numbers.' configure.ac gf.spec
-
-6. Run autoconf to generate configure with the right version number:
-
- $ autoconf
-
-7. Go back to the root of the tree.
-
- $ cd ..
-
-8. Tag the release. (X_X should be replaced by the version number, with
- _ instead of ., e.g. 2_0)
-
- $ darcs tag -m RELEASE-X_X
-
-9. Push the changes that you made for the release to the main repo:
-
- $ darcs push
-
-10. Build a source package:
-
- $ cd src
- $ ./configure
- $ make dist
-
-11. (Only if releasing a new grammars distribution)
- Build a grammar tarball:
-
- $ cd src
- $ ./configure && make grammar-dist
-
-12. Build an x86/linux RPM (should be done on a Mandrake Linux box):
-
- Setup for building RPMs (first time only):
-
- - Make sure that you have the directories neccessary to build
- RPMs:
-
- $ mkdir -p ~/rpm/{BUILD,RPMS/i586,RPMS/noarch,SOURCES,SRPMS,SPECS,tmp}
-
- - Create ~/.rpmrc with the following contents:
-
-buildarchtranslate: i386: i586
-buildarchtranslate: i486: i586
-buildarchtranslate: i586: i586
-buildarchtranslate: i686: i586
-
- - Create ~/.rpmmacros with the following contents:
-
-%_topdir %(echo ${HOME}/rpm)
-%_tmppath %{_topdir}/tmp
-
-%packager Your Name <yourusername@cs.chalmers.se>
-
- Build the RPM:
-
- $ cd src
- $ ./configure && make rpm
-
-13. Build a generic binary x86/linux package (should be done on a Linux box,
- e.g. banded.medic.chalmers.se):
-
- $ cd src
- $ ./configure --host=i386-pc-linux-gnu && make binary-dist
-
-14. Build a generic binary sparc/solaris package (should be done
- on a Solaris box, e.g. remote1.cs.chalmers.se):
-
- $ cd src
- $ ./configure --host=sparc-sun-solaris2 && gmake binary-dist
-
-15. Build a Mac OS X package (should be done on a Mac OS X box,
- e.g. csmisc99.cs.chalmers.se):
-
- $ cd src
- $ ./configure && make binary-dist
-
- Note that to run GHC-compiled binaries on OS X, you need
- a "Haskell Support Framework". This should be available
- separately from the GF download page.
-
- TODO: Use OS X PackageMaker to build a .pkg-file which can
- be installed using the standard OS X Installer program.
-
-16. Build a binary Cygwin package (should be done on a Windows
- machine with Cygwin):
-
- $ cd src
- $ ./configure && make binary-dist
-
-17. Build a Windows MSI package (FIXME: This doesn't work right,
- pathnames with backslashes and spaces are not handled
- correctly in Windows. We only release a binary tarball
- for Cygwin right now.):
-
- $ cd src
- $ ./configure && make all windows-msi
-
-18. Add new GF package release to SourceForge:
-
- - https://sourceforge.net/projects/gf-tools
-
- - Project page -> Admin -> File releases -> Add release (for the
- GF package)
-
- - New release name: X.X (just the version number, e.g. 2.2)
-
- - Paste in release notes
-
- - Upload files using anonymous FTP to upload.sourceforge.net
- in the incoming directory.
-
- - Add the files to the release and set the processor
- and file type for each file (remember to press
- Update/Refresh for each file):
- * x86 rpm -> i386/.rpm
- * source rpm -> Any/Source .rpm
- * x86 binary tarball -> i386/.gz
- * sparc binary tarball -> Sparc/.gz
- * source package -> Any/Source .gz
-
-19. Add new GF-editor release. Repeat the steps above, but
- with GF-editor:
-
- - Add files and set properties:
-
- * editor rpm -> i386/.rpm (not really true, but I haven't
- figured out how to make noarch rpms from the same spec as
- arch-specific ones)
-
-20. Mail to gf-tools-users@lists.sourceforge.net
-
-21. Update website.
-
-22. Party!
-
diff --git a/src/GF.hs b/src/compiler/GF.hs
index 32a95ca1f..32a95ca1f 100644
--- a/src/GF.hs
+++ b/src/compiler/GF.hs
diff --git a/src/GF/Command/Abstract.hs b/src/compiler/GF/Command/Abstract.hs
index 1f7c4014e..1f7c4014e 100644
--- a/src/GF/Command/Abstract.hs
+++ b/src/compiler/GF/Command/Abstract.hs
diff --git a/src/GF/Command/Commands.hs b/src/compiler/GF/Command/Commands.hs
index d8e2a3023..d8e2a3023 100644
--- a/src/GF/Command/Commands.hs
+++ b/src/compiler/GF/Command/Commands.hs
diff --git a/src/GF/Command/Importing.hs b/src/compiler/GF/Command/Importing.hs
index 06deab6c6..06deab6c6 100644
--- a/src/GF/Command/Importing.hs
+++ b/src/compiler/GF/Command/Importing.hs
diff --git a/src/GF/Command/Interpreter.hs b/src/compiler/GF/Command/Interpreter.hs
index ff84da8a3..ff84da8a3 100644
--- a/src/GF/Command/Interpreter.hs
+++ b/src/compiler/GF/Command/Interpreter.hs
diff --git a/src/GF/Command/Messages.hs b/src/compiler/GF/Command/Messages.hs
index 8dda92d49..8dda92d49 100644
--- a/src/GF/Command/Messages.hs
+++ b/src/compiler/GF/Command/Messages.hs
diff --git a/src/GF/Command/Parse.hs b/src/compiler/GF/Command/Parse.hs
index 44366c472..44366c472 100644
--- a/src/GF/Command/Parse.hs
+++ b/src/compiler/GF/Command/Parse.hs
diff --git a/src/GF/Command/TreeOperations.hs b/src/compiler/GF/Command/TreeOperations.hs
index 941f03782..941f03782 100644
--- a/src/GF/Command/TreeOperations.hs
+++ b/src/compiler/GF/Command/TreeOperations.hs
diff --git a/src/GF/Compile.hs b/src/compiler/GF/Compile.hs
index e0c60178e..e0c60178e 100644
--- a/src/GF/Compile.hs
+++ b/src/compiler/GF/Compile.hs
diff --git a/src/GF/Compile/Abstract/Compute.hs b/src/compiler/GF/Compile/Abstract/Compute.hs
index d5c9a163c..d5c9a163c 100644
--- a/src/GF/Compile/Abstract/Compute.hs
+++ b/src/compiler/GF/Compile/Abstract/Compute.hs
diff --git a/src/GF/Compile/Abstract/TC.hs b/src/compiler/GF/Compile/Abstract/TC.hs
index 163301838..163301838 100644
--- a/src/GF/Compile/Abstract/TC.hs
+++ b/src/compiler/GF/Compile/Abstract/TC.hs
diff --git a/src/GF/Compile/Abstract/TypeCheck.hs b/src/compiler/GF/Compile/Abstract/TypeCheck.hs
index 2632c54dd..2632c54dd 100644
--- a/src/GF/Compile/Abstract/TypeCheck.hs
+++ b/src/compiler/GF/Compile/Abstract/TypeCheck.hs
diff --git a/src/GF/Compile/CheckGrammar.hs b/src/compiler/GF/Compile/CheckGrammar.hs
index f4765eb26..f4765eb26 100644
--- a/src/GF/Compile/CheckGrammar.hs
+++ b/src/compiler/GF/Compile/CheckGrammar.hs
diff --git a/src/GF/Compile/Coding.hs b/src/compiler/GF/Compile/Coding.hs
index 49538bd35..49538bd35 100644
--- a/src/GF/Compile/Coding.hs
+++ b/src/compiler/GF/Compile/Coding.hs
diff --git a/src/GF/Compile/Concrete/AppPredefined.hs b/src/compiler/GF/Compile/Concrete/AppPredefined.hs
index c05127191..c05127191 100644
--- a/src/GF/Compile/Concrete/AppPredefined.hs
+++ b/src/compiler/GF/Compile/Concrete/AppPredefined.hs
diff --git a/src/GF/Compile/Concrete/Compute.hs b/src/compiler/GF/Compile/Concrete/Compute.hs
index 9c016116b..9c016116b 100644
--- a/src/GF/Compile/Concrete/Compute.hs
+++ b/src/compiler/GF/Compile/Concrete/Compute.hs
diff --git a/src/GF/Compile/Concrete/TypeCheck.hs b/src/compiler/GF/Compile/Concrete/TypeCheck.hs
index 670f36625..670f36625 100644
--- a/src/GF/Compile/Concrete/TypeCheck.hs
+++ b/src/compiler/GF/Compile/Concrete/TypeCheck.hs
diff --git a/src/GF/Compile/Export.hs b/src/compiler/GF/Compile/Export.hs
index d03eb947e..d03eb947e 100644
--- a/src/GF/Compile/Export.hs
+++ b/src/compiler/GF/Compile/Export.hs
diff --git a/src/GF/Compile/GFCCtoHaskell.hs b/src/compiler/GF/Compile/GFCCtoHaskell.hs
index d44d6705c..d44d6705c 100644
--- a/src/GF/Compile/GFCCtoHaskell.hs
+++ b/src/compiler/GF/Compile/GFCCtoHaskell.hs
diff --git a/src/GF/Compile/GFCCtoJS.hs b/src/compiler/GF/Compile/GFCCtoJS.hs
index 312701e3b..312701e3b 100644
--- a/src/GF/Compile/GFCCtoJS.hs
+++ b/src/compiler/GF/Compile/GFCCtoJS.hs
diff --git a/src/GF/Compile/GFCCtoProlog.hs b/src/compiler/GF/Compile/GFCCtoProlog.hs
index 702d4afe5..702d4afe5 100644
--- a/src/GF/Compile/GFCCtoProlog.hs
+++ b/src/compiler/GF/Compile/GFCCtoProlog.hs
diff --git a/src/GF/Compile/GenerateFCFG.hs b/src/compiler/GF/Compile/GenerateFCFG.hs
index 52e95f686..52e95f686 100644
--- a/src/GF/Compile/GenerateFCFG.hs
+++ b/src/compiler/GF/Compile/GenerateFCFG.hs
diff --git a/src/GF/Compile/GeneratePMCFG.hs b/src/compiler/GF/Compile/GeneratePMCFG.hs
index 458cf3f5c..458cf3f5c 100644
--- a/src/GF/Compile/GeneratePMCFG.hs
+++ b/src/compiler/GF/Compile/GeneratePMCFG.hs
diff --git a/src/GF/Compile/GeneratePMCFGOld.hs b/src/compiler/GF/Compile/GeneratePMCFGOld.hs
index 244ed68fe..244ed68fe 100644
--- a/src/GF/Compile/GeneratePMCFGOld.hs
+++ b/src/compiler/GF/Compile/GeneratePMCFGOld.hs
diff --git a/src/GF/Compile/GetGrammar.hs b/src/compiler/GF/Compile/GetGrammar.hs
index c85f9588f..c85f9588f 100644
--- a/src/GF/Compile/GetGrammar.hs
+++ b/src/compiler/GF/Compile/GetGrammar.hs
diff --git a/src/GF/Compile/GrammarToGFCC.hs b/src/compiler/GF/Compile/GrammarToGFCC.hs
index fb92ef74c..fb92ef74c 100644
--- a/src/GF/Compile/GrammarToGFCC.hs
+++ b/src/compiler/GF/Compile/GrammarToGFCC.hs
diff --git a/src/GF/Compile/ModDeps.hs b/src/compiler/GF/Compile/ModDeps.hs
index 1e689aabc..1e689aabc 100644
--- a/src/GF/Compile/ModDeps.hs
+++ b/src/compiler/GF/Compile/ModDeps.hs
diff --git a/src/GF/Compile/Optimize.hs b/src/compiler/GF/Compile/Optimize.hs
index 2c556b36f..2c556b36f 100644
--- a/src/GF/Compile/Optimize.hs
+++ b/src/compiler/GF/Compile/Optimize.hs
diff --git a/src/GF/Compile/OptimizeGFCC.hs b/src/compiler/GF/Compile/OptimizeGFCC.hs
index 2a218e1bb..2a218e1bb 100644
--- a/src/GF/Compile/OptimizeGFCC.hs
+++ b/src/compiler/GF/Compile/OptimizeGFCC.hs
diff --git a/src/GF/Compile/PGFPretty.hs b/src/compiler/GF/Compile/PGFPretty.hs
index 679714db5..679714db5 100644
--- a/src/GF/Compile/PGFPretty.hs
+++ b/src/compiler/GF/Compile/PGFPretty.hs
diff --git a/src/GF/Compile/ReadFiles.hs b/src/compiler/GF/Compile/ReadFiles.hs
index b96d3127b..b96d3127b 100644
--- a/src/GF/Compile/ReadFiles.hs
+++ b/src/compiler/GF/Compile/ReadFiles.hs
diff --git a/src/GF/Compile/Refresh.hs b/src/compiler/GF/Compile/Refresh.hs
index 04800fcce..04800fcce 100644
--- a/src/GF/Compile/Refresh.hs
+++ b/src/compiler/GF/Compile/Refresh.hs
diff --git a/src/GF/Compile/Rename.hs b/src/compiler/GF/Compile/Rename.hs
index 30616b4cb..30616b4cb 100644
--- a/src/GF/Compile/Rename.hs
+++ b/src/compiler/GF/Compile/Rename.hs
diff --git a/src/GF/Compile/SubExOpt.hs b/src/compiler/GF/Compile/SubExOpt.hs
index c7dbb5d3d..c7dbb5d3d 100644
--- a/src/GF/Compile/SubExOpt.hs
+++ b/src/compiler/GF/Compile/SubExOpt.hs
diff --git a/src/GF/Compile/Update.hs b/src/compiler/GF/Compile/Update.hs
index 1e39a2e03..1e39a2e03 100644
--- a/src/GF/Compile/Update.hs
+++ b/src/compiler/GF/Compile/Update.hs
diff --git a/src/GF/Data/Assoc.hs b/src/compiler/GF/Data/Assoc.hs
index f775319ea..f775319ea 100644
--- a/src/GF/Data/Assoc.hs
+++ b/src/compiler/GF/Data/Assoc.hs
diff --git a/src/GF/Data/BacktrackM.hs b/src/compiler/GF/Data/BacktrackM.hs
index 36317ebb6..36317ebb6 100644
--- a/src/GF/Data/BacktrackM.hs
+++ b/src/compiler/GF/Data/BacktrackM.hs
diff --git a/src/GF/Data/ErrM.hs b/src/compiler/GF/Data/ErrM.hs
index e8cea12d4..e8cea12d4 100644
--- a/src/GF/Data/ErrM.hs
+++ b/src/compiler/GF/Data/ErrM.hs
diff --git a/src/GF/Data/Graph.hs b/src/compiler/GF/Data/Graph.hs
index bfb289860..bfb289860 100644
--- a/src/GF/Data/Graph.hs
+++ b/src/compiler/GF/Data/Graph.hs
diff --git a/src/GF/Data/Graphviz.hs b/src/compiler/GF/Data/Graphviz.hs
index 411f76898..411f76898 100644
--- a/src/GF/Data/Graphviz.hs
+++ b/src/compiler/GF/Data/Graphviz.hs
diff --git a/src/GF/Data/MultiMap.hs b/src/compiler/GF/Data/MultiMap.hs
index e565f433b..e565f433b 100644
--- a/src/GF/Data/MultiMap.hs
+++ b/src/compiler/GF/Data/MultiMap.hs
diff --git a/src/GF/Data/Operations.hs b/src/compiler/GF/Data/Operations.hs
index 7b2afc9fe..7b2afc9fe 100644
--- a/src/GF/Data/Operations.hs
+++ b/src/compiler/GF/Data/Operations.hs
diff --git a/src/GF/Data/Relation.hs b/src/compiler/GF/Data/Relation.hs
index 7024a482c..7024a482c 100644
--- a/src/GF/Data/Relation.hs
+++ b/src/compiler/GF/Data/Relation.hs
diff --git a/src/GF/Data/SortedList.hs b/src/compiler/GF/Data/SortedList.hs
index d77ff68d4..d77ff68d4 100644
--- a/src/GF/Data/SortedList.hs
+++ b/src/compiler/GF/Data/SortedList.hs
diff --git a/src/GF/Data/Str.hs b/src/compiler/GF/Data/Str.hs
index 6f65764c7..6f65764c7 100644
--- a/src/GF/Data/Str.hs
+++ b/src/compiler/GF/Data/Str.hs
diff --git a/src/GF/Data/TrieMap.hs b/src/compiler/GF/Data/TrieMap.hs
index a6749d641..a6749d641 100644
--- a/src/GF/Data/TrieMap.hs
+++ b/src/compiler/GF/Data/TrieMap.hs
diff --git a/src/GF/Data/Utilities.hs b/src/compiler/GF/Data/Utilities.hs
index 74d3ef81e..74d3ef81e 100644
--- a/src/GF/Data/Utilities.hs
+++ b/src/compiler/GF/Data/Utilities.hs
diff --git a/src/GF/Data/XML.hs b/src/compiler/GF/Data/XML.hs
index bdc6f98a1..bdc6f98a1 100644
--- a/src/GF/Data/XML.hs
+++ b/src/compiler/GF/Data/XML.hs
diff --git a/src/GF/Data/Zipper.hs b/src/compiler/GF/Data/Zipper.hs
index a4491f76e..a4491f76e 100644
--- a/src/GF/Data/Zipper.hs
+++ b/src/compiler/GF/Data/Zipper.hs
diff --git a/src/GF/Grammar.hs b/src/compiler/GF/Grammar.hs
index c540f77b8..c540f77b8 100644
--- a/src/GF/Grammar.hs
+++ b/src/compiler/GF/Grammar.hs
diff --git a/src/GF/Grammar/Binary.hs b/src/compiler/GF/Grammar/Binary.hs
index fbad5ac7e..fbad5ac7e 100644
--- a/src/GF/Grammar/Binary.hs
+++ b/src/compiler/GF/Grammar/Binary.hs
diff --git a/src/GF/Grammar/CF.hs b/src/compiler/GF/Grammar/CF.hs
index a1d716994..a1d716994 100644
--- a/src/GF/Grammar/CF.hs
+++ b/src/compiler/GF/Grammar/CF.hs
diff --git a/src/GF/Grammar/Grammar.hs b/src/compiler/GF/Grammar/Grammar.hs
index 8d1468d9d..8d1468d9d 100644
--- a/src/GF/Grammar/Grammar.hs
+++ b/src/compiler/GF/Grammar/Grammar.hs
diff --git a/src/GF/Grammar/Lexer.hs b/src/compiler/GF/Grammar/Lexer.hs
index 7cacb0588..7cacb0588 100644
--- a/src/GF/Grammar/Lexer.hs
+++ b/src/compiler/GF/Grammar/Lexer.hs
diff --git a/src/GF/Grammar/Lexer.x b/src/compiler/GF/Grammar/Lexer.x
index d6f49bbb1..d6f49bbb1 100644
--- a/src/GF/Grammar/Lexer.x
+++ b/src/compiler/GF/Grammar/Lexer.x
diff --git a/src/GF/Grammar/Lockfield.hs b/src/compiler/GF/Grammar/Lockfield.hs
index 3e78a48b6..3e78a48b6 100644
--- a/src/GF/Grammar/Lockfield.hs
+++ b/src/compiler/GF/Grammar/Lockfield.hs
diff --git a/src/GF/Grammar/Lookup.hs b/src/compiler/GF/Grammar/Lookup.hs
index 074f0c5ec..074f0c5ec 100644
--- a/src/GF/Grammar/Lookup.hs
+++ b/src/compiler/GF/Grammar/Lookup.hs
diff --git a/src/GF/Grammar/MMacros.hs b/src/compiler/GF/Grammar/MMacros.hs
index a7f746b66..a7f746b66 100644
--- a/src/GF/Grammar/MMacros.hs
+++ b/src/compiler/GF/Grammar/MMacros.hs
diff --git a/src/GF/Grammar/Macros.hs b/src/compiler/GF/Grammar/Macros.hs
index 799cd9ec5..799cd9ec5 100644
--- a/src/GF/Grammar/Macros.hs
+++ b/src/compiler/GF/Grammar/Macros.hs
diff --git a/src/GF/Grammar/Parser.y b/src/compiler/GF/Grammar/Parser.y
index 320053674..320053674 100644
--- a/src/GF/Grammar/Parser.y
+++ b/src/compiler/GF/Grammar/Parser.y
diff --git a/src/GF/Grammar/PatternMatch.hs b/src/compiler/GF/Grammar/PatternMatch.hs
index b8f7eff7d..b8f7eff7d 100644
--- a/src/GF/Grammar/PatternMatch.hs
+++ b/src/compiler/GF/Grammar/PatternMatch.hs
diff --git a/src/GF/Grammar/Predef.hs b/src/compiler/GF/Grammar/Predef.hs
index 045df06ca..045df06ca 100644
--- a/src/GF/Grammar/Predef.hs
+++ b/src/compiler/GF/Grammar/Predef.hs
diff --git a/src/GF/Grammar/Printer.hs b/src/compiler/GF/Grammar/Printer.hs
index 06cac9705..06cac9705 100644
--- a/src/GF/Grammar/Printer.hs
+++ b/src/compiler/GF/Grammar/Printer.hs
diff --git a/src/GF/Grammar/Unify.hs b/src/compiler/GF/Grammar/Unify.hs
index 9bb49cfe2..9bb49cfe2 100644
--- a/src/GF/Grammar/Unify.hs
+++ b/src/compiler/GF/Grammar/Unify.hs
diff --git a/src/GF/Grammar/Values.hs b/src/compiler/GF/Grammar/Values.hs
index 1a68ddc89..1a68ddc89 100644
--- a/src/GF/Grammar/Values.hs
+++ b/src/compiler/GF/Grammar/Values.hs
diff --git a/src/GF/Infra/CheckM.hs b/src/compiler/GF/Infra/CheckM.hs
index 8a1b42cdf..8a1b42cdf 100644
--- a/src/GF/Infra/CheckM.hs
+++ b/src/compiler/GF/Infra/CheckM.hs
diff --git a/src/GF/Infra/CompactPrint.hs b/src/compiler/GF/Infra/CompactPrint.hs
index 486c9e183..486c9e183 100644
--- a/src/GF/Infra/CompactPrint.hs
+++ b/src/compiler/GF/Infra/CompactPrint.hs
diff --git a/src/GF/Infra/Dependencies.hs b/src/compiler/GF/Infra/Dependencies.hs
index af2088711..af2088711 100644
--- a/src/GF/Infra/Dependencies.hs
+++ b/src/compiler/GF/Infra/Dependencies.hs
diff --git a/src/GF/Infra/GetOpt.hs b/src/compiler/GF/Infra/GetOpt.hs
index ede561c90..ede561c90 100644
--- a/src/GF/Infra/GetOpt.hs
+++ b/src/compiler/GF/Infra/GetOpt.hs
diff --git a/src/GF/Infra/Ident.hs b/src/compiler/GF/Infra/Ident.hs
index efe6f9261..efe6f9261 100644
--- a/src/GF/Infra/Ident.hs
+++ b/src/compiler/GF/Infra/Ident.hs
diff --git a/src/GF/Infra/Modules.hs b/src/compiler/GF/Infra/Modules.hs
index 0710b8f40..0710b8f40 100644
--- a/src/GF/Infra/Modules.hs
+++ b/src/compiler/GF/Infra/Modules.hs
diff --git a/src/GF/Infra/Option.hs b/src/compiler/GF/Infra/Option.hs
index dc15d1929..dc15d1929 100644
--- a/src/GF/Infra/Option.hs
+++ b/src/compiler/GF/Infra/Option.hs
diff --git a/src/GF/Infra/UseIO.hs b/src/compiler/GF/Infra/UseIO.hs
index bb1a75b6e..bb1a75b6e 100644
--- a/src/GF/Infra/UseIO.hs
+++ b/src/compiler/GF/Infra/UseIO.hs
diff --git a/src/GF/JavaScript/AbsJS.hs b/src/compiler/GF/JavaScript/AbsJS.hs
index 2632ade48..2632ade48 100644
--- a/src/GF/JavaScript/AbsJS.hs
+++ b/src/compiler/GF/JavaScript/AbsJS.hs
diff --git a/src/GF/JavaScript/JS.cf b/src/compiler/GF/JavaScript/JS.cf
index fe31a2074..fe31a2074 100644
--- a/src/GF/JavaScript/JS.cf
+++ b/src/compiler/GF/JavaScript/JS.cf
diff --git a/src/GF/JavaScript/LexJS.x b/src/compiler/GF/JavaScript/LexJS.x
index 10ba66d69..10ba66d69 100644
--- a/src/GF/JavaScript/LexJS.x
+++ b/src/compiler/GF/JavaScript/LexJS.x
diff --git a/src/GF/JavaScript/Makefile b/src/compiler/GF/JavaScript/Makefile
index 10f867b06..10f867b06 100644
--- a/src/GF/JavaScript/Makefile
+++ b/src/compiler/GF/JavaScript/Makefile
diff --git a/src/GF/JavaScript/ParJS.y b/src/compiler/GF/JavaScript/ParJS.y
index bf0614757..bf0614757 100644
--- a/src/GF/JavaScript/ParJS.y
+++ b/src/compiler/GF/JavaScript/ParJS.y
diff --git a/src/GF/JavaScript/PrintJS.hs b/src/compiler/GF/JavaScript/PrintJS.hs
index 4e04e3cbf..4e04e3cbf 100644
--- a/src/GF/JavaScript/PrintJS.hs
+++ b/src/compiler/GF/JavaScript/PrintJS.hs
diff --git a/src/GF/Quiz.hs b/src/compiler/GF/Quiz.hs
index 52d9dee6b..52d9dee6b 100644
--- a/src/GF/Quiz.hs
+++ b/src/compiler/GF/Quiz.hs
diff --git a/src/GF/Speech/CFG.hs b/src/compiler/GF/Speech/CFG.hs
index 9ec8416c5..9ec8416c5 100644
--- a/src/GF/Speech/CFG.hs
+++ b/src/compiler/GF/Speech/CFG.hs
diff --git a/src/GF/Speech/CFGToFA.hs b/src/compiler/GF/Speech/CFGToFA.hs
index 3045ac842..3045ac842 100644
--- a/src/GF/Speech/CFGToFA.hs
+++ b/src/compiler/GF/Speech/CFGToFA.hs
diff --git a/src/GF/Speech/FiniteState.hs b/src/compiler/GF/Speech/FiniteState.hs
index 136d773a2..136d773a2 100644
--- a/src/GF/Speech/FiniteState.hs
+++ b/src/compiler/GF/Speech/FiniteState.hs
diff --git a/src/GF/Speech/GSL.hs b/src/compiler/GF/Speech/GSL.hs
index 8f26ea64c..8f26ea64c 100644
--- a/src/GF/Speech/GSL.hs
+++ b/src/compiler/GF/Speech/GSL.hs
diff --git a/src/GF/Speech/JSGF.hs b/src/compiler/GF/Speech/JSGF.hs
index 2cfeea5f5..2cfeea5f5 100644
--- a/src/GF/Speech/JSGF.hs
+++ b/src/compiler/GF/Speech/JSGF.hs
diff --git a/src/GF/Speech/PGFToCFG.hs b/src/compiler/GF/Speech/PGFToCFG.hs
index d22a4ea8d..d22a4ea8d 100644
--- a/src/GF/Speech/PGFToCFG.hs
+++ b/src/compiler/GF/Speech/PGFToCFG.hs
diff --git a/src/GF/Speech/PrRegExp.hs b/src/compiler/GF/Speech/PrRegExp.hs
index 0fc35d541..0fc35d541 100644
--- a/src/GF/Speech/PrRegExp.hs
+++ b/src/compiler/GF/Speech/PrRegExp.hs
diff --git a/src/GF/Speech/RegExp.hs b/src/compiler/GF/Speech/RegExp.hs
index 2592b3d57..2592b3d57 100644
--- a/src/GF/Speech/RegExp.hs
+++ b/src/compiler/GF/Speech/RegExp.hs
diff --git a/src/GF/Speech/SISR.hs b/src/compiler/GF/Speech/SISR.hs
index f966d96b9..f966d96b9 100644
--- a/src/GF/Speech/SISR.hs
+++ b/src/compiler/GF/Speech/SISR.hs
diff --git a/src/GF/Speech/SLF.hs b/src/compiler/GF/Speech/SLF.hs
index 84633149b..84633149b 100644
--- a/src/GF/Speech/SLF.hs
+++ b/src/compiler/GF/Speech/SLF.hs
diff --git a/src/GF/Speech/SRG.hs b/src/compiler/GF/Speech/SRG.hs
index 2270ec7a1..2270ec7a1 100644
--- a/src/GF/Speech/SRG.hs
+++ b/src/compiler/GF/Speech/SRG.hs
diff --git a/src/GF/Speech/SRGS_ABNF.hs b/src/compiler/GF/Speech/SRGS_ABNF.hs
index 2df1316a8..2df1316a8 100644
--- a/src/GF/Speech/SRGS_ABNF.hs
+++ b/src/compiler/GF/Speech/SRGS_ABNF.hs
diff --git a/src/GF/Speech/SRGS_XML.hs b/src/compiler/GF/Speech/SRGS_XML.hs
index 1f94de66d..1f94de66d 100644
--- a/src/GF/Speech/SRGS_XML.hs
+++ b/src/compiler/GF/Speech/SRGS_XML.hs
diff --git a/src/GF/Speech/VoiceXML.hs b/src/compiler/GF/Speech/VoiceXML.hs
index 134964062..134964062 100644
--- a/src/GF/Speech/VoiceXML.hs
+++ b/src/compiler/GF/Speech/VoiceXML.hs
diff --git a/src/GF/System/NoReadline.hs b/src/compiler/GF/System/NoReadline.hs
index 1f1050e8c..1f1050e8c 100644
--- a/src/GF/System/NoReadline.hs
+++ b/src/compiler/GF/System/NoReadline.hs
diff --git a/src/GF/System/NoSignal.hs b/src/compiler/GF/System/NoSignal.hs
index 5d82a431e..5d82a431e 100644
--- a/src/GF/System/NoSignal.hs
+++ b/src/compiler/GF/System/NoSignal.hs
diff --git a/src/GF/System/Readline.hs b/src/compiler/GF/System/Readline.hs
index ee38cdc0b..ee38cdc0b 100644
--- a/src/GF/System/Readline.hs
+++ b/src/compiler/GF/System/Readline.hs
diff --git a/src/GF/System/Signal.hs b/src/compiler/GF/System/Signal.hs
index fe8a12483..fe8a12483 100644
--- a/src/GF/System/Signal.hs
+++ b/src/compiler/GF/System/Signal.hs
diff --git a/src/GF/System/UseEditline.hs b/src/compiler/GF/System/UseEditline.hs
index 6d51a1be3..6d51a1be3 100644
--- a/src/GF/System/UseEditline.hs
+++ b/src/compiler/GF/System/UseEditline.hs
diff --git a/src/GF/System/UseHaskeline.hs b/src/compiler/GF/System/UseHaskeline.hs
index 140407439..140407439 100644
--- a/src/GF/System/UseHaskeline.hs
+++ b/src/compiler/GF/System/UseHaskeline.hs
diff --git a/src/GF/System/UseReadline.hs b/src/compiler/GF/System/UseReadline.hs
index a0e051601..a0e051601 100644
--- a/src/GF/System/UseReadline.hs
+++ b/src/compiler/GF/System/UseReadline.hs
diff --git a/src/GF/System/UseSignal.hs b/src/compiler/GF/System/UseSignal.hs
index 20c70a568..20c70a568 100644
--- a/src/GF/System/UseSignal.hs
+++ b/src/compiler/GF/System/UseSignal.hs
diff --git a/src/GF/Text/CP1250.hs b/src/compiler/GF/Text/CP1250.hs
index 474c04ace..474c04ace 100644
--- a/src/GF/Text/CP1250.hs
+++ b/src/compiler/GF/Text/CP1250.hs
diff --git a/src/GF/Text/CP1251.hs b/src/compiler/GF/Text/CP1251.hs
index 7c277abab..7c277abab 100644
--- a/src/GF/Text/CP1251.hs
+++ b/src/compiler/GF/Text/CP1251.hs
diff --git a/src/GF/Text/CP1252.hs b/src/compiler/GF/Text/CP1252.hs
index 1e5affe53..1e5affe53 100644
--- a/src/GF/Text/CP1252.hs
+++ b/src/compiler/GF/Text/CP1252.hs
diff --git a/src/GF/Text/Coding.hs b/src/compiler/GF/Text/Coding.hs
index e3cd7b0ea..e3cd7b0ea 100644
--- a/src/GF/Text/Coding.hs
+++ b/src/compiler/GF/Text/Coding.hs
diff --git a/src/GF/Text/Lexing.hs b/src/compiler/GF/Text/Lexing.hs
index 3300d311e..3300d311e 100644
--- a/src/GF/Text/Lexing.hs
+++ b/src/compiler/GF/Text/Lexing.hs
diff --git a/src/GF/Text/Transliterations.hs b/src/compiler/GF/Text/Transliterations.hs
index e2747f506..e2747f506 100644
--- a/src/GF/Text/Transliterations.hs
+++ b/src/compiler/GF/Text/Transliterations.hs
diff --git a/src/GF/Text/UTF8.hs b/src/compiler/GF/Text/UTF8.hs
index 5e9687684..5e9687684 100644
--- a/src/GF/Text/UTF8.hs
+++ b/src/compiler/GF/Text/UTF8.hs
diff --git a/src/GFC.hs b/src/compiler/GFC.hs
index 8037d4f1a..8037d4f1a 100644
--- a/src/GFC.hs
+++ b/src/compiler/GFC.hs
diff --git a/src/GFI.hs b/src/compiler/GFI.hs
index 2ea22efa6..2ea22efa6 100644
--- a/src/GFI.hs
+++ b/src/compiler/GFI.hs
diff --git a/src/config.guess b/src/config.guess
deleted file mode 100644
index c085f4f51..000000000
--- a/src/config.guess
+++ /dev/null
@@ -1,1497 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
-
-timestamp='2006-05-13'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit ;;
- *:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
- *:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
- macppc:MirBSD:*:*)
- echo powerppc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Pn.n version is a patched version.
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
- *:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
- DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- i86pc:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
- exit ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
- then
- echo "$SYSTEM_NAME"
- else
- echo rs6000-ibm-aix3.2.5
- fi
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit ;;
- *:AIX:*:[45])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- eval $set_cc_for_build
-
- # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
- # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
- # generating 64-bit code. GNU and HP use different nomenclature:
- #
- # $ CC_FOR_BUILD=cc ./config.guess
- # => hppa2.0w-hp-hpux11.23
- # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
- # => hppa64-hp-hpux11.23
-
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep __LP64__ >/dev/null
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- *:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- esac
- exit ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
- i*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
- x86:Interix*:[345]*)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
- EM64T:Interix*:[345]*)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
- amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- *:GNU:*:*)
- # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
- exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit ;;
- arm*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- cris:Linux:*:*)
- echo cris-axis-linux-gnu
- exit ;;
- crisv32:Linux:*:*)
- echo crisv32-axis-linux-gnu
- exit ;;
- frv:Linux:*:*)
- echo frv-unknown-linux-gnu
- exit ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- mips:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips
- #undef mipsel
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
- ;;
- mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips64
- #undef mips64el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
- ;;
- or32:Linux:*:*)
- echo or32-unknown-linux-gnu
- exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
- esac
- exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
- exit ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
- exit ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu
- exit ;;
- x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
- exit ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^LIBC/{
- s: ::g
- p
- }'`"
- test x"${LIBC}" != x && {
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
- exit
- }
- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
- ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit ;;
- i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
- i*86:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- case $UNAME_PROCESSOR in
- unknown) UNAME_PROCESSOR=powerpc ;;
- esac
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NSE-?:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
- *:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
- esac ;;
- *:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
- i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
- i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
- exit ;;
- c4*)
- echo c4-convex-bsd
- exit ;;
- esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
-and
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/src/config.mk.in b/src/config.mk.in
deleted file mode 100644
index e8a8ab567..000000000
--- a/src/config.mk.in
+++ /dev/null
@@ -1,37 +0,0 @@
-# GF configuration file. configure will produce config.mk from this file
-# @configure_input@
-
-PACKAGE_VERSION = @PACKAGE_VERSION@
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-libdir = @libdir@
-datadir = @datadir@
-
-host = @host@
-build = @build@
-
-GHCFLAGS = @GHCFLAGS@
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-
-EXEEXT = @EXEEXT@
-
-INSTALL = @INSTALL@
-TAR = @TAR@
-
-GHC = "@GHC@"
-GHCI = "@GHCI@"
-
-READLINE = @READLINE@
-
-INTERRUPT = @INTERRUPT@
-
-ATK = @ATK@
-
-ENABLE_JAVA = @ENABLE_JAVA@
-
-JAVAC = "@JAVAC@"
-JAR = "@JAR@"
-
diff --git a/src/config.sub b/src/config.sub
deleted file mode 100644
index 4d936e239..000000000
--- a/src/config.sub
+++ /dev/null
@@ -1,1608 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
-
-timestamp='2006-05-13'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit ;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray)
- os=
- basic_machine=$1
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
- | bfin \
- | c4x | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64vr | mips64vrel \
- | mips64orion | mips64orionel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | mt \
- | msp430 \
- | nios | nios2 \
- | ns16k | ns32k \
- | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
- | pyramid \
- | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
- | v850 | v850e \
- | we32k \
- | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
- | z8k)
- basic_machine=$basic_machine-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12)
- # Motorola 68HC11/12.
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
- ms1)
- basic_machine=mt-unknown
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nios-* | nios2-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
- | pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tron-* \
- | v850-* | v850e-* | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
- | xstormy16-* | xtensa-* \
- | ymp-* \
- | z8k-*)
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16c)
- basic_machine=cr16c-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- mmix)
- basic_machine=mmix-knuth
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -kaos*)
- os=-kaos
- ;;
- -zvmoe)
- os=-zvmoe
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- spu-*)
- os=-elf
- ;;
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-haiku)
- os=-haiku
- ;;
- *-ibm)
- os=-aix
- ;;
- *-knuth)
- os=-mmixware
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/src/configure.ac b/src/configure.ac
deleted file mode 100644
index c38acbff5..000000000
--- a/src/configure.ac
+++ /dev/null
@@ -1,229 +0,0 @@
-dnl Run autoconf to generate configure from this file
-
-AC_INIT([GF],[3.0-beta3],[aarne@cs.chalmers.se],[GF])
-
-AC_PREREQ(2.53)
-
-AC_REVISION($Revision: 1.26 $)
-
-AC_CONFIG_FILES([config.mk gfc])
-
-AC_CANONICAL_HOST
-
-dnl ***********************************************
-dnl Executable suffix
-dnl ***********************************************
-
-
-AC_MSG_CHECKING([executable suffix])
-case $host_os in
- cygwin)
- EXEEXT='.exe';;
- *)
- EXEEXT='';;
-esac
-AC_MSG_RESULT(['$EXEEXT'])
-AC_SUBST(EXEEXT)
-
-dnl ***********************************************
-dnl GHC
-dnl ***********************************************
-
-AC_ARG_WITH(ghc,
- AC_HELP_STRING([--with-ghc=<ghc command>],
- [Use a different command instead of
- 'ghc' for the Haskell compiler.]),
- [AC_CHECK_FILE("$withval",GHC="$withval",[AC_PATH_PROG(GHC,"$withval")])],
- [AC_PATH_PROG(GHC,ghc)])
-
-GHCI=$(dirname $GHC)/ghci
-
-GHC_VERSION=`$GHC --version | sed -e 's/.*version //'`
-AC_MSG_CHECKING([GHC version])
-AC_MSG_RESULT($GHC_VERSION)
-
-
-AC_SUBST(GHC)
-AC_SUBST(GHCI)
-
-dnl ***********************************************
-dnl readline
-dnl ***********************************************
-
-AC_ARG_WITH(readline,
- AC_HELP_STRING([--with-readline=<readline alternative>],
- [Select which readline implementation to use.
- Available alternatives are: 'readline' (GNU readline),
- 'no' (don't use readline)
- (default = readline)]),
- [if test "$withval" = "yes"; then
- READLINE="readline"
- else
- READLINE="$withval"
- fi],
- [if test "$host_os" = "cygwin"; then
- AC_MSG_WARN([There are problems with readline for Windows,
- for example, pipe characters do not work.
- Disabling readline support.
- Use --with-readline to override.])
- READLINE="no"
- else
- READLINE="readline"
- fi])
-
-case $READLINE in
- readline)
- ;;
- no)
- ;;
- *)
- AC_MSG_ERROR([Bad value for --with-readline: $READLINE])
- ;;
-esac
-
-AC_SUBST(READLINE)
-
-dnl ***********************************************
-dnl command interruption
-dnl ***********************************************
-
-AC_ARG_WITH(interrupt,
- AC_HELP_STRING([--with-interrupt=<allow command interruption>],
- [Choose whether to enable interruption of commands
- with SIGINT (Ctrl-C)
- Available alternatives are: 'yes', 'no'
- (default = yes)]),
- [INTERRUPT="$withval"],
- [if test "$host_os" = "cygwin"; then
- AC_MSG_WARN([Command interruption does not work under
- Cygwin, because of missing signal handler support.
- Disabling command interruption support.
- Use --with-interrupt to override.])
- INTERRUPT="no"
- else
- INTERRUPT="yes"
- fi])
-
-case $INTERRUPT in
- yes)
- ;;
- no)
- ;;
- *)
- AC_MSG_ERROR([Bad value for --with-interrupt: $INTERRUPT])
- ;;
-esac
-
-AC_SUBST(INTERRUPT)
-
-dnl ***********************************************
-dnl ATK speech recognition
-dnl ***********************************************
-
-AC_ARG_WITH(atk,
- AC_HELP_STRING([--with-atk=<use ATK speech recognition>],
- [Choose whether to compile in support for speech
- recognition using ATK. Requires ATK and libatkrec.
- Available alternatives are: 'yes', 'no'
- (default = no)]),
- [ATK="$withval"],
- [ATK="no"])
-
-case $ATK in
- yes)
- AC_MSG_CHECKING([for atkrec package])
- ATKREC_VERSION=`ghc-pkg field atkrec version`
- if test "$ATKREC_VERSION" = ""; then
- AC_MSG_RESULT(['not found'])
- AC_MSG_WARN([Disabling ATK support.])
- ATK="no"
- else
- AC_MSG_RESULT([$ATKREC_VERSION])
- fi
- ;;
- no)
- ;;
- *)
- AC_MSG_ERROR([Bad value for --with-atk: $ATK])
-
- ;;
-esac
-
-AC_SUBST(ATK)
-
-dnl ***********************************************
-dnl java stuff
-dnl ***********************************************
-
-AC_ARG_ENABLE(java,
-AC_HELP_STRING([--enable-java],
- [Build Java components. (default = yes)]),
-[ENABLE_JAVA="$enableval"],
-[ENABLE_JAVA=yes]
-)
-
-if test "$ENABLE_JAVA" = "yes"; then
-
- AC_ARG_WITH(javac,
- AC_HELP_STRING([--with-javac=<javac command>],
- [Use a different command instead of
- 'javac' for the Java compiler.]),
- [AC_CHECK_FILE("$withval",JAVAC="$withval",[AC_PATH_PROG(JAVAC,"$withval")])],
- [AC_PATH_PROG(JAVAC,javac)])
- AC_SUBST(JAVAC)
-
- AC_ARG_WITH(java,
- AC_HELP_STRING([--with-java=<java command>],
- [Use a different command instead of
- 'java' for the Java Virtual Machine.]),
- [AC_CHECK_FILE("$withval",JAVA="$withval",[AC_PATH_PROG(JAVA,"$withval")])],
- [AC_PATH_PROG(JAVA,java)])
- AC_SUBST(JAVA)
-
- AC_ARG_WITH(jar,
- AC_HELP_STRING([--with-jar=<jar command>],
- [Use a different command instead of
- 'jar' for the Java archive tool.]),
- [AC_CHECK_FILE("$withval",JAR="$withval",[AC_PATH_PROG(JAR,"$withval")])],
- [AC_PATH_PROG(JAR,jar)])
- AC_SUBST(JAR)
-
- if test "$JAVAC" = "" || test ! -x "$JAVAC" \
- || test "$JAVA" = "" || test ! -x "$JAVA" \
- || test "$JAR" = "" || test ! -x "$JAR"; then
-
- AC_MSG_WARN([Not building Java components.])
- ENABLE_JAVA=no
- fi
-
-fi
-
-AC_SUBST(ENABLE_JAVA)
-
-
-dnl ***********************************************
-dnl TAR
-dnl ***********************************************
-
-AC_CHECK_PROGS(TAR, gtar tar)
-
-dnl ***********************************************
-dnl Other programs
-dnl ***********************************************
-
-AC_PROG_INSTALL
-
-dnl ***********************************************
-dnl Program flags
-dnl ***********************************************
-
-AC_SUBST(GHCFLAGS)
-AC_SUBST(CPPFLAGS)
-AC_SUBST(LDFLAGS)
-
-dnl ***********************************************
-dnl Output
-dnl ***********************************************
-
-AC_OUTPUT
-
diff --git a/src/exper/EditShell.hs b/src/exper/EditShell.hs
deleted file mode 100644
index dd7fd8eea..000000000
--- a/src/exper/EditShell.hs
+++ /dev/null
@@ -1,136 +0,0 @@
-module Main where
-
-import PGF.Editor
-import PGF
-
-import Data.Char
-import System (getArgs)
-
--- a rough editor shell using the PGF.Edito API
--- compile:
--- cd .. ; ghc --make exper/EditShell.hs
--- use:
--- EditShell file.pgf
-
-main = do
- putStrLn "Hi, I'm the Editor! Type h for help on commands."
- file:_ <- getArgs
- pgf <- readPGF file
- let dict = pgf2dict pgf
- let st0 = new (startCat pgf)
- let lang = head (languages pgf) ---- for printnames; enable choosing lang
- editLoop pgf dict lang st0 -- alt 1: all editing commands
--- dialogueLoop pgf dict lang st0 -- alt 2: just refinement by parsing (see bottom)
-
-editLoop :: PGF -> Dict -> Language -> State -> IO State
-editLoop pgf dict lang st = do
- putStrLn $
- if null (allMetas st)
- then unlines
- (["The tree is complete:",prState st] ++ linearizeAll pgf (stateTree st))
- else if isMetaFocus st
- then "I want something of type " ++ showType (focusType st) ++
- " (0 - " ++ show (length (refineMenu dict st)-1) ++ ")"
- else "Do you want to change this node?"
- c <- getLine
- st' <- interpret pgf dict st c
- editLoop pgf dict lang st'
-
-interpret :: PGF -> Dict -> State -> String -> IO State
-interpret pgf dict st c = case words c of
- "r":f:_ -> do
- let st' = goNextMeta (refine dict (mkCId f) st)
- prLState pgf st'
- return st'
- "p":ws -> do
- let tts = parseAll pgf (focusType st) (dropWhile (not . isSpace) c)
- st' <- selectReplace dict (concat tts) st
- prLState pgf st'
- return st'
- "a":_ -> do
- t:_ <- generateRandom pgf (focusType st)
- let st' = goNextMeta (replace dict t st)
- prLState pgf st'
- return st'
- "d":_ -> do
- let st' = delete st
- prLState pgf st'
- return st'
- "m":_ -> do
- putStrLn (unwords (map prCId (refineMenu dict st)))
- return st
- d : _ | all isDigit d -> do
- let f = refineMenu dict st !! read d
- let st' = goNextMeta (refine dict f st)
- prLState pgf st'
- return st'
- p@('[':_):_ -> do
- let st' = goPosition (mkPosition (read p)) st
- prLState pgf st'
- return st'
- ">":_ -> do
- let st' = goNext st
- prLState pgf st'
- return st'
- "x":_ -> do
- mapM_ putStrLn [show (showPosition p) ++ showType t | (p,t) <- allMetas st]
- return st
- "h":_ -> putStrLn commandHelp >> return st
- _ -> do
- putStrLn "command not understood"
- return st
-
-prLState pgf st = do
- let t = stateTree st
- putStrLn (unlines ([
- "Now I have:","",
- prState st] ++
- linearizeAll pgf t))
-
--- prompt selection from list of trees, such as ambiguous choice
-selectReplace :: Dict -> [Tree] -> State -> IO State
-selectReplace dict ts st = case ts of
- [] -> putStrLn "no results" >> return st
- [t] -> return $ goNextMeta $ replace dict t st
- _ -> do
- mapM_ putStrLn $ "choose tree by entering its number:" :
- [show i ++ " : " ++ showTree t | (i,t) <- zip [0..] ts]
- d <- getLine
- let t = ts !! read d
- return $ goNextMeta $ replace dict t st
-
-commandHelp = unlines [
- "a -- refine with a random subtree",
- "d -- delete current subtree",
- "h -- display this help message",
- "m -- show refinement menu",
- "p Anything -- parse Anything and refine with it",
- "r Function -- refine with Function",
- "x -- show all unknown positions and their types",
- "4 -- refine with 4th item from menu (see m)",
- "[1,2,3] -- go to position 1,2,3",
- "> -- go to next node"
- ]
-
-----------------
--- for a dialogue system, working just by parsing; questions are cat printnames
-----------------
-
-dialogueLoop :: PGF -> Dict -> Language -> State -> IO State
-dialogueLoop pgf dict lang st = do
- putStrLn $
- if null (allMetas st)
- then "Ready!\n " ++ unlines (linearizeAll pgf (stateTree st))
- else if isMetaFocus st
- then showPrintName pgf lang (focusType st)
- else "Do you want to change this node?"
- c <- getLine
- st' <- interpretD pgf dict st c
- dialogueLoop pgf dict lang st'
-
-interpretD :: PGF -> Dict -> State -> String -> IO State
-interpretD pgf dict st c = do
- let tts = parseAll pgf (focusType st) c
- st' <- selectReplace dict (concat tts) st
--- prLState pgf st'
- return st'
diff --git a/src/exper/Evaluate.hs b/src/exper/Evaluate.hs
deleted file mode 100644
index 413c82402..000000000
--- a/src/exper/Evaluate.hs
+++ /dev/null
@@ -1,461 +0,0 @@
-----------------------------------------------------------------------
--- |
--- Module : Evaluate
--- Maintainer : AR
--- Stability : (stable)
--- Portability : (portable)
---
--- > CVS $Date: 2005/11/01 15:39:12 $
--- > CVS $Author: aarne $
--- > CVS $Revision: 1.19 $
---
--- Computation of source terms. Used in compilation and in @cc@ command.
------------------------------------------------------------------------------
-
-module GF.Compile.Evaluate (appEvalConcrete) where
-
-import GF.Data.Operations
-import GF.Grammar.Grammar
-import GF.Infra.Ident
-import GF.Data.Str
-import GF.Grammar.PrGrammar
-import GF.Infra.Modules
-import GF.Infra.Option
-import GF.Grammar.Macros
-import GF.Grammar.Lookup
-import GF.Grammar.Refresh
-import GF.Grammar.PatternMatch
-import GF.Grammar.Lockfield (isLockLabel) ----
-
-import GF.Grammar.AppPredefined
-
-import qualified Data.Map as Map
-
-import Data.List (nub,intersperse)
-import Control.Monad (liftM2, liftM)
-import Debug.Trace
-
-
-data EEnv = EEnv {
- computd :: Map.Map (Ident,Ident) FTerm,
- temp :: Int
- }
-
-emptyEEnv = EEnv Map.empty 0
-
-lookupComputed :: (Ident,Ident) -> STM EEnv (Maybe FTerm)
-lookupComputed mc = do
- env <- readSTM
- return $ Map.lookup mc $ computd env
-
-updateComputed :: (Ident,Ident) -> FTerm -> STM EEnv ()
-updateComputed mc t = updateSTM (\e -> e{computd = Map.insert mc t (computd e)})
-
-getTemp :: STM EEnv Ident
-getTemp = do
- env <- readSTM
- updateSTM (\e -> e{temp = temp e + 1})
- return $ identC ("#" ++ show (temp env))
-
-data FTerm =
- FTC Term
- | FTF (Term -> FTerm)
-
-prFTerm :: Integer -> FTerm -> String
-prFTerm i t = case t of
- FTC t -> prt t
- FTF f -> show i +++ "->" +++ prFTerm (i + 1) (f (EInt i))
-
-term2fterm t = case t of
- Abs x b -> FTF (\t -> term2fterm (subst [(x,t)] b))
- _ -> FTC t
-
-traceFTerm c ft = ft ----trace ("\n" ++ prt c +++ "=" +++ take 60 (prFTerm 0 ft)) ft
-
-fterm2term :: FTerm -> STM EEnv Term
-fterm2term t = case t of
- FTC t -> return t
- FTF f -> do
- x <- getTemp
- b <- fterm2term $ f (Vr x)
- return $ Abs x b
-
-subst g t = case t of
- Vr x -> maybe t id $ lookup x g
- _ -> composSafeOp (subst g) t
-
-
-appFTerm :: FTerm -> [Term] -> FTerm
-appFTerm ft ts = case (ft,ts) of
- (FTF f, x:xs) -> appFTerm (f x) xs
- _ -> ft
-{-
- (FTC _, []) -> ft
- (FTC f, [a]) -> case appPredefined (App f a) of
- Ok (t,_) -> FTC t
- _ -> error $ "error: appFTerm" +++ prFTerm 0 ft +++ unwords (map prt ts)
- _ -> error $ "error: appFTerm" +++ prFTerm 0 ft +++ unwords (map prt ts)
--}
-
-apps :: Term -> (Term,[Term])
-apps t = case t of
- App f a -> (f',xs ++ [a]) where (f',xs) = apps f
- _ -> (t,[])
-
-appEvalConcrete gr bt = liftM fst $ appSTM (evalConcrete gr bt) emptyEEnv
-
-evalConcrete :: SourceGrammar -> BinTree Ident Info -> STM EEnv (BinTree Ident Info)
-evalConcrete gr mo = mapMTree evaldef mo where
-
- evaldef (f,info) = case info of
- CncFun (mt@(Just (_,ty@(cont,val)))) pde ppr ->
- evalIn ("\nerror in linearization of function" +++ prt f +++ ":") $
- do
- pde' <- case pde of
- Yes de -> do
- liftM yes $ pEval ty de
- _ -> return pde
- --- ppr' <- liftM yes $ evalPrintname gr c ppr pde'
- return $ (f, CncFun mt pde' ppr) -- only cat in type actually needed
-
- _ -> return (f,info)
-
- pEval (context,val) trm = do ---- errIn ("parteval" +++ prt_ trm) $ do
- let
- vars = map fst context
- args = map Vr vars
- subst = [(v, Vr v) | v <- vars]
- trm1 = mkApp trm args
- trm3 <- recordExpand val trm1 >>= comp subst
- return $ mkAbs vars trm3
-
- recordExpand typ trm = case unComputed typ of
- RecType tys -> case trm of
- FV rs -> return $ FV [R [assign lab (P r lab) | (lab,_) <- tys] | r <- rs]
- _ -> return $ R [assign lab (P trm lab) | (lab,_) <- tys]
- _ -> return trm
-
- comp g t = case t of
-
- Q (IC "Predef") _ -> trace ("\nPredef:\n" ++ prt t) $ return t
-
- Q p c -> do
- md <- lookupComputed (p,c)
- case md of
- Nothing -> do
- d <- lookRes (p,c)
- updateComputed (p,c) $ traceFTerm c $ term2fterm d
- return d
- Just d -> fterm2term d >>= comp g
- App f a -> case apps t of
- (h@(Q p c),xs) | p == IC "Predef" -> do
- xs' <- mapM (comp g) xs
- (t',b) <- stmErr $ appPredefined (foldl App h xs')
- if b then return t' else comp g t'
- (h@(Q p c),xs) -> do
- xs' <- mapM (comp g) xs
- md <- lookupComputed (p,c)
- case md of
- Just ft -> do
- t <- fterm2term $ appFTerm ft xs'
- comp g t
- Nothing -> do
- d <- lookRes (p,c)
- let ft = traceFTerm c $ term2fterm d
- updateComputed (p,c) ft
- t' <- fterm2term $ appFTerm ft xs'
- comp g t'
- _ -> do
- f' <- comp g f
- a' <- comp g a
- case (f',a') of
- (Abs x b,_) -> comp (ext x a' g) b
- (QC _ _,_) -> returnC $ App f' a'
- (FV fs, _) -> mapM (\c -> comp g (App c a')) fs >>= return . variants
- (_, FV as) -> mapM (\c -> comp g (App f' c)) as >>= return . variants
-
- (Alias _ _ d, _) -> comp g (App d a')
-
- (S (T i cs) e,_) -> prawitz g i (flip App a') cs e
-
- _ -> do
- (t',b) <- stmErr $ appPredefined (App f' a')
- if b then return t' else comp g t'
-
-
- Vr x -> do
- t' <- maybe (prtRaise (
- "context" +++ show g +++ ": no value given to variable") x) return $ lookup x g
- case t' of
- _ | t == t' -> return t
- _ -> comp g t'
-
- Abs x b -> do
- b' <- comp (ext x (Vr x) g) b
- return $ Abs x b'
-
- Let (x,(_,a)) b -> do
- a' <- comp g a
- comp (ext x a' g) b
-
- Prod x a b -> do
- a' <- comp g a
- b' <- comp (ext x (Vr x) g) b
- return $ Prod x a' b'
-
- P t l | isLockLabel l -> return $ R []
- ---- a workaround 18/2/2005: take this away and find the reason
- ---- why earlier compilation destroys the lock field
-
-
- P t l -> do
- t' <- comp g t
- case t' of
- FV rs -> mapM (\c -> comp g (P c l)) rs >>= returnC . variants
- R r -> maybe
- (prtRaise (prt t' ++ ": no value for label") l) (comp g . snd) $
- lookup l r
-
- ExtR a (R b) -> case lookup l b of ----comp g (P (R b) l) of
- Just (_,v) -> comp g v
- _ -> comp g (P a l)
-
- S (T i cs) e -> prawitz g i (flip P l) cs e
-
- _ -> returnC $ P t' l
-
- S t@(T _ cc) v -> do
- v' <- comp g v
- case v' of
- FV vs -> do
- ts' <- mapM (comp g . S t) vs
- return $ variants ts'
- _ -> case matchPattern cc v' of
- Ok (c,g') -> comp (g' ++ g) c
- _ | isCan v' -> prtRaise ("missing case" +++ prt v' +++ "in") t
- _ -> do
- t' <- comp g t
- return $ S t' v' -- if v' is not canonical
-
- S t v -> do
- t' <- comp g t
- v' <- comp g v
- case t' of
- T _ [(PV IW,c)] -> comp g c --- an optimization
- T _ [(PT _ (PV IW),c)] -> comp g c
-
- T _ [(PV z,c)] -> comp (ext z v' g) c --- another optimization
- T _ [(PT _ (PV z),c)] -> comp (ext z v' g) c
-
- FV ccs -> mapM (\c -> comp g (S c v')) ccs >>= returnC . variants
-
- V ptyp ts -> do
- vs <- stmErr $ allParamValues gr ptyp
- ps <- stmErr $ mapM term2patt vs
- let cc = zip ps ts
- case v' of
- FV vs -> mapM (\c -> comp g (S t' c)) vs >>= returnC . variants
- _ -> case matchPattern cc v' of
- Ok (c,g') -> comp (g' ++ g) c
- _ | isCan v' -> prtRaise ("missing case" +++ prt v' +++ "in") t
- _ -> return $ S t' v' -- if v' is not canonical
-
- T _ cc -> case v' of
- FV vs -> mapM (\c -> comp g (S t' c)) vs >>= returnC . variants
- _ -> case matchPattern cc v' of
- Ok (c,g') -> comp (g' ++ g) c
- _ | isCan v' -> prtRaise ("missing case" +++ prt v' +++ "in") t
- _ -> return $ S t' v' -- if v' is not canonical
-
- Alias _ _ d -> comp g (S d v')
-
- S (T i cs) e -> prawitz g i (flip S v') cs e
-
- _ -> returnC $ S t' v'
-
- -- normalize away empty tokens
- K "" -> return Empty
-
- -- glue if you can
- Glue x0 y0 -> do
- x <- comp g x0
- y <- comp g y0
- case (x,y) of
- (Alias _ _ d, y) -> comp g $ Glue d y
- (x, Alias _ _ d) -> comp g $ Glue x d
-
- (S (T i cs) e, s) -> prawitz g i (flip Glue s) cs e
- (s, S (T i cs) e) -> prawitz g i (Glue s) cs e
- (_,Empty) -> return x
- (Empty,_) -> return y
- (K a, K b) -> return $ K (a ++ b)
- (_, Alts (d,vs)) -> do
----- (K a, Alts (d,vs)) -> do
- let glx = Glue x
- comp g $ Alts (glx d, [(glx v,c) | (v,c) <- vs])
- (Alts _, ka) -> checks [do
- y' <- stmErr $ strsFromTerm ka
----- (Alts _, K a) -> checks [do
- x' <- stmErr $ strsFromTerm x -- this may fail when compiling opers
- return $ variants [
- foldr1 C (map K (str2strings (glueStr v u))) | v <- x', u <- y']
----- foldr1 C (map K (str2strings (glueStr v (str a)))) | v <- x']
- ,return $ Glue x y
- ]
- (FV ks,_) -> do
- kys <- mapM (comp g . flip Glue y) ks
- return $ variants kys
- (_,FV ks) -> do
- xks <- mapM (comp g . Glue x) ks
- return $ variants xks
-
- _ -> do
- mapM_ checkNoArgVars [x,y]
- r <- composOp (comp g) t
- returnC r
-
- Alts _ -> do
- r <- composOp (comp g) t
- returnC r
-
- -- remove empty
- C a b -> do
- a' <- comp g a
- b' <- comp g b
- case (a',b') of
- (Alts _, K a) -> checks [do
- as <- stmErr $ strsFromTerm a' -- this may fail when compiling opers
- return $ variants [
- foldr1 C (map K (str2strings (plusStr v (str a)))) | v <- as]
- ,
- return $ C a' b'
- ]
- (Empty,_) -> returnC b'
- (_,Empty) -> returnC a'
- _ -> returnC $ C a' b'
-
- -- reduce free variation as much as you can
- FV ts -> mapM (comp g) ts >>= returnC . variants
-
- -- merge record extensions if you can
- ExtR r s -> do
- r' <- comp g r
- s' <- comp g s
- case (r',s') of
- (Alias _ _ d, _) -> comp g $ ExtR d s'
- (_, Alias _ _ d) -> comp g $ Glue r' d
-
- (R rs, R ss) -> stmErr $ plusRecord r' s'
- (RecType rs, RecType ss) -> stmErr $ plusRecType r' s'
- _ -> return $ ExtR r' s'
-
- -- case-expand tables
- -- if already expanded, don't expand again
- T i@(TComp _) cs -> do
- -- if there are no variables, don't even go inside
- cs' <- if (null g) then return cs else mapPairsM (comp g) cs
- return $ T i cs'
-
- --- this means some extra work; should implement TSh directly
- TSh i cs -> comp g $ T i [(p,v) | (ps,v) <- cs, p <- ps]
-
- T i cs -> do
- pty0 <- stmErr $ getTableType i
- ptyp <- comp g pty0
- case allParamValues gr ptyp of
- Ok vs -> do
-
- cs' <- mapM (compBranchOpt g) cs
- sts <- stmErr $ mapM (matchPattern cs') vs
- ts <- mapM (\ (c,g') -> comp (g' ++ g) c) sts
- ps <- stmErr $ mapM term2patt vs
- let ps' = ps --- PT ptyp (head ps) : tail ps
- return $ --- V ptyp ts -- to save space, just course of values
- T (TComp ptyp) (zip ps' ts)
- _ -> do
- cs' <- mapM (compBranch g) cs
- return $ T i cs' -- happens with variable types
-
- -- otherwise go ahead
- _ -> composOp (comp g) t >>= returnC
-
- lookRes (p,c) = case lookupResDefKind gr p c of
- Ok (t,_) | noExpand p -> return t
- Ok (t,0) -> comp [] t
- Ok (t,_) -> return t
- Bad s -> raise s
-
- noExpand p = errVal False $ do
- mo <- lookupModule gr p
- return $ case getOptVal (iOpts (flags mo)) useOptimizer of
- Just "noexpand" -> True
- _ -> False
-
- prtRaise s t = raise (s +++ prt t)
-
- ext x a g = (x,a):g
-
- returnC = return --- . computed
-
- variants ts = case nub ts of
- [t] -> t
- ts -> FV ts
-
- isCan v = case v of
- Con _ -> True
- QC _ _ -> True
- App f a -> isCan f && isCan a
- R rs -> all (isCan . snd . snd) rs
- _ -> False
-
- compBranch g (p,v) = do
- let g' = contP p ++ g
- v' <- comp g' v
- return (p,v')
-
- compBranchOpt g c@(p,v) = case contP p of
- [] -> return c
- _ -> compBranch g c
----- _ -> err (const (return c)) return $ compBranch g c
-
- contP p = case p of
- PV x -> [(x,Vr x)]
- PC _ ps -> concatMap contP ps
- PP _ _ ps -> concatMap contP ps
- PT _ p -> contP p
- PR rs -> concatMap (contP . snd) rs
-
- PAs x p -> (x,Vr x) : contP p
-
- PSeq p q -> concatMap contP [p,q]
- PAlt p q -> concatMap contP [p,q]
- PRep p -> contP p
- PNeg p -> contP p
-
- _ -> []
-
- prawitz g i f cs e = do
- cs' <- mapM (compBranch g) [(p, f v) | (p,v) <- cs]
- return $ S (T i cs') e
-
--- | argument variables cannot be glued
-checkNoArgVars :: Term -> STM EEnv Term
-checkNoArgVars t = case t of
- Vr (IA _) -> raise $ glueErrorMsg $ prt t
- Vr (IAV _) -> raise $ glueErrorMsg $ prt t
- _ -> composOp checkNoArgVars t
-
-glueErrorMsg s =
- "Cannot glue (+) term with run-time variable" +++ s ++ "." ++++
- "Use Prelude.bind instead."
-
-stmErr :: Err a -> STM s a
-stmErr e = stm (\s -> do
- v <- e
- return (v,s)
- )
-
-evalIn :: String -> STM s a -> STM s a
-evalIn msg st = stm $ \s -> case appSTM st s of
- Bad e -> Bad $ msg ++++ e
- Ok vs -> Ok vs
diff --git a/src/exper/Optimize.hs b/src/exper/Optimize.hs
deleted file mode 100644
index 7cf88554f..000000000
--- a/src/exper/Optimize.hs
+++ /dev/null
@@ -1,273 +0,0 @@
-----------------------------------------------------------------------
--- |
--- Module : Optimize
--- Maintainer : AR
--- Stability : (stable)
--- Portability : (portable)
---
--- > CVS $Date: 2005/09/16 13:56:13 $
--- > CVS $Author: aarne $
--- > CVS $Revision: 1.18 $
---
--- Top-level partial evaluation for GF source modules.
------------------------------------------------------------------------------
-
-module GF.Compile.Optimize (optimizeModule) where
-
-import GF.Grammar.Grammar
-import GF.Infra.Ident
-import GF.Infra.Modules
-import GF.Grammar.PrGrammar
-import GF.Grammar.Macros
-import GF.Grammar.Lookup
-import GF.Grammar.Refresh
-import GF.Grammar.Compute
-import GF.Compile.BackOpt
-import GF.Compile.CheckGrammar
-import GF.Compile.Update
-
-import GF.Compile.Evaluate
-
-import GF.Data.Operations
-import GF.Infra.CheckM
-import GF.Infra.Option
-
-import Control.Monad
-import Data.List
-
--- | partial evaluation of concrete syntax. AR 6\/2001 -- 16\/5\/2003 -- 5\/2\/2005.
--- only do this for resource: concrete is optimized in gfc form
-optimizeModule :: Options -> [(Ident,SourceModule)] -> (Ident,SourceModule) ->
- Err (Ident,SourceModule)
-optimizeModule opts ms mo@(_,mi) = case mi of
- m0@(Module mt st fs me ops js) | st == MSComplete && isModRes m0 -> do
- mo1 <- evalModule oopts ms mo
- return $ case optim of
- "parametrize" -> shareModule paramOpt mo1 -- parametrization and sharing
- "values" -> shareModule valOpt mo1 -- tables as courses-of-values
- "share" -> shareModule shareOpt mo1 -- sharing of branches
- "all" -> shareModule allOpt mo1 -- first parametrize then values
- "none" -> mo1 -- no optimization
- _ -> mo1 -- none; default for src
- _ -> evalModule oopts ms mo
- where
- oopts = addOptions opts (iOpts (flagsModule mo))
- optim = maybe "all" id $ getOptVal oopts useOptimizer
-
-evalModule :: Options -> [(Ident,SourceModule)] -> (Ident,SourceModule) -> Err (Ident,SourceModule)
-evalModule oopts ms mo@(name,mod) = case mod of
-
- m0@(Module mt st fs me ops js) | st == MSComplete -> case mt of
-{-
- -- now: don't optimize resource
-
- _ | isModRes m0 -> do
- let deps = allOperDependencies name js
- ids <- topoSortOpers deps
- MGrammar (mod' : _) <- foldM evalOp gr ids
- return $ mod'
--}
- MTConcrete a -> do
------
- js0 <- appEvalConcrete gr js
- js' <- mapMTree (evalCncInfo oopts gr name a) js0 ---- <- gr0 6/12/2005
- return $ (name, Module mt st fs me ops js')
-
- _ -> return $ (name,mod)
- _ -> return $ (name,mod)
- where
- gr0 = MGrammar $ ms
- gr = MGrammar $ (name,mod) : ms
-
- evalOp g@(MGrammar ((_, m) : _)) i = do
- info <- lookupTree prt i $ jments m
- info' <- evalResInfo oopts gr (i,info)
- return $ updateRes g name i info'
-
--- | only operations need be compiled in a resource, and this is local to each
--- definition since the module is traversed in topological order
-evalResInfo :: Options -> SourceGrammar -> (Ident,Info) -> Err Info
-evalResInfo oopts gr (c,info) = case info of
-
- ResOper pty pde -> eIn "operation" $ do
- pde' <- case pde of
- Yes de | optres -> liftM yes $ comp de
- _ -> return pde
- return $ ResOper pty pde'
-
- _ -> return info
- where
- comp = if optres then computeConcrete gr else computeConcreteRec gr
- eIn cat = errIn ("Error optimizing" +++ cat +++ prt c +++ ":")
- optim = maybe "all" id $ getOptVal oopts useOptimizer
- optres = case optim of
- "noexpand" -> False
- _ -> True
-
-
-evalCncInfo ::
- Options -> SourceGrammar -> Ident -> Ident -> (Ident,Info) -> Err (Ident,Info)
-evalCncInfo opts gr cnc abs (c,info) = errIn ("optimizing" +++ prt c) $ case info of
-
- CncCat ptyp pde ppr -> do
-
- pde' <- case (ptyp,pde) of
- (Yes typ, Yes de) ->
- liftM yes $ pEval ([(varStr, typeStr)], typ) de
- (Yes typ, Nope) ->
- liftM yes $ mkLinDefault gr typ >>= partEval noOptions gr ([(varStr, typeStr)],typ)
- (May b, Nope) ->
- return $ May b
- _ -> return pde -- indirection
-
- ppr' <- liftM yes $ evalPrintname gr c ppr (yes $ K $ prt c)
-
- return (c, CncCat ptyp pde' ppr')
-
- CncFun (mt@(Just (_,ty@(cont,val)))) pde ppr ->
- eIn ("linearization in type" +++ prt (mkProd (cont,val,[])) ++++ "of function") $ do
- pde' <- case pde of
------ Yes de -> do
------ liftM yes $ pEval ty de
- _ -> return pde
- ppr' <- liftM yes $ evalPrintname gr c ppr pde'
- return $ (c, CncFun mt pde' ppr') -- only cat in type actually needed
-
- _ -> return (c,info)
- where
- pEval = partEval opts gr
- eIn cat = errIn ("Error optimizing" +++ cat +++ prt c +++ ":")
-
--- | the main function for compiling linearizations
-partEval :: Options -> SourceGrammar -> (Context,Type) -> Term -> Err Term
-partEval opts gr (context, val) trm = errIn ("parteval" +++ prt_ trm) $ do
- let vars = map fst context
- args = map Vr vars
- subst = [(v, Vr v) | v <- vars]
- trm1 = mkApp trm args
- trm3 <- if globalTable
- then etaExpand trm1 >>= comp subst >>= outCase subst
- else etaExpand trm1 >>= comp subst
- return $ mkAbs vars trm3
-
- where
-
- globalTable = oElem showAll opts --- i -all
-
- comp g t = {- refreshTerm t >>= -} computeTerm gr g t
-
- etaExpand t = recordExpand val t --- >>= caseEx -- done by comp
-
- outCase subst t = do
- pts <- getParams context
- let (args,ptyps) = unzip $ filter (flip occur t . fst) pts
- if null args
- then return t
- else do
- let argtyp = RecType $ tuple2recordType ptyps
- let pvars = map (Vr . zIdent . prt) args -- gets eliminated
- patt <- term2patt $ R $ tuple2record $ pvars
- let t' = replace (zip args pvars) t
- t1 <- comp subst $ T (TTyped argtyp) [(patt, t')]
- return $ S t1 $ R $ tuple2record args
-
- --- notice: this assumes that all lin types follow the "old JFP style"
- getParams = liftM concat . mapM getParam
- getParam (argv,RecType rs) = return
- [(P (Vr argv) lab, ptyp) | (lab,ptyp) <- rs, not (isLinLabel lab)]
- ---getParam (_,ty) | ty==typeStr = return [] --- in lindef
- getParam (av,ty) =
- Bad ("record type expected not" +++ prt ty +++ "for" +++ prt av)
- --- all lin types are rec types
-
- replace :: [(Term,Term)] -> Term -> Term
- replace reps trm = case trm of
- -- this is the important case
- P _ _ -> maybe trm id $ lookup trm reps
- _ -> composSafeOp (replace reps) trm
-
- occur t trm = case trm of
-
- -- this is the important case
- P _ _ -> t == trm
- S x y -> occur t y || occur t x
- App f x -> occur t x || occur t f
- Abs _ f -> occur t f
- R rs -> any (occur t) (map (snd . snd) rs)
- T _ cs -> any (occur t) (map snd cs)
- C x y -> occur t x || occur t y
- Glue x y -> occur t x || occur t y
- ExtR x y -> occur t x || occur t y
- FV ts -> any (occur t) ts
- V _ ts -> any (occur t) ts
- Let (_,(_,x)) y -> occur t x || occur t y
- _ -> False
-
-
--- here we must be careful not to reduce
--- variants {{s = "Auto" ; g = N} ; {s = "Wagen" ; g = M}}
--- {s = variants {"Auto" ; "Wagen"} ; g = variants {N ; M}} ;
-
-recordExpand :: Type -> Term -> Err Term
-recordExpand typ trm = case unComputed typ of
- RecType tys -> case trm of
- FV rs -> return $ FV [R [assign lab (P r lab) | (lab,_) <- tys] | r <- rs]
- _ -> return $ R [assign lab (P trm lab) | (lab,_) <- tys]
- _ -> return trm
-
-
--- | auxiliaries for compiling the resource
-
-mkLinDefault :: SourceGrammar -> Type -> Err Term
-mkLinDefault gr typ = do
- case unComputed typ of
- RecType lts -> mapPairsM mkDefField lts >>= (return . Abs varStr . R . mkAssign)
- _ -> prtBad "linearization type must be a record type, not" typ
- where
- mkDefField typ = case unComputed typ of
- Table p t -> do
- t' <- mkDefField t
- let T _ cs = mkWildCases t'
- return $ T (TWild p) cs
- Sort "Str" -> return $ Vr varStr
- QC q p -> lookupFirstTag gr q p
- RecType r -> do
- let (ls,ts) = unzip r
- ts' <- mapM mkDefField ts
- return $ R $ [assign l t | (l,t) <- zip ls ts']
- _ | isTypeInts typ -> return $ EInt 0 -- exists in all as first val
- _ -> prtBad "linearization type field cannot be" typ
-
--- | Form the printname: if given, compute. If not, use the computed
--- lin for functions, cat name for cats (dispatch made in evalCncDef above).
---- We cannot use linearization at this stage, since we do not know the
---- defaults we would need for question marks - and we're not yet in canon.
-evalPrintname :: SourceGrammar -> Ident -> MPr -> Perh Term -> Err Term
-evalPrintname gr c ppr lin =
- case ppr of
- Yes pr -> comp pr
- _ -> case lin of
- Yes t -> return $ K $ clean $ prt $ oneBranch t ---- stringFromTerm
- _ -> return $ K $ prt c ----
- where
- comp = computeConcrete gr
-
- oneBranch t = case t of
- Abs _ b -> oneBranch b
- R (r:_) -> oneBranch $ snd $ snd r
- T _ (c:_) -> oneBranch $ snd c
- V _ (c:_) -> oneBranch c
- FV (t:_) -> oneBranch t
- C x y -> C (oneBranch x) (oneBranch y)
- S x _ -> oneBranch x
- P x _ -> oneBranch x
- Alts (d,_) -> oneBranch d
- _ -> t
-
- --- very unclean cleaner
- clean s = case s of
- '+':'+':' ':cs -> clean cs
- '"':cs -> clean cs
- c:cs -> c: clean cs
- _ -> s
-
diff --git a/src/gf.spec b/src/gf.spec
deleted file mode 100644
index 8dfbee6f5..000000000
--- a/src/gf.spec
+++ /dev/null
@@ -1,119 +0,0 @@
-%define name GF
-%define version 3.0
-%define release 1
-
-Name: %{name}
-Summary: Grammatical Framework
-Version: %{version}
-Release: %{release}
-License: GPL
-Group: Sciences/Other
-Vendor: The Language Technology Group
-URL: http://www.cs.chalmers.se/~aarne/GF/
-Source: GF-%{version}.tgz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
-BuildRequires: ghc
-
-%description
-The Grammatical Framework (=GF) is a grammar formalism based on type theory.
-It consists of
-
- * a special-purpose programming language
- * a compiler of the language
- * a generic grammar processor
-
-The compiler reads GF grammars from user-provided files, and the
-generic grammar processor performs various tasks with the grammars:
-
- * generation
- * parsing
- * translation
- * type checking
- * computation
- * paraphrasing
- * random generation
- * syntax editing
-
-GF particularly addresses the following aspects of grammars:
-
- * multilinguality (parallel grammars for different languages)
- * semantics (semantic conditions of well-formedness, semantic
- properties of expressions)
- * grammar engineering (modularity, information hiding, reusable
- libraries)
-
-
-%package editor
-Summary: Java syntax editor for Grammatical Framework (GF).
-Group: Sciences/Other
-Requires: %{name}
-
-%description editor
-This package contains the syntax editor GUI for GF.
-
-%package editor2
-Summary: Java syntax editor for Grammatical Framework (GF).
-Group: Sciences/Other
-Requires: %{name}
-
-%description editor2
-This package contains the syntax editor GUI for GF with printname enhancements and HTML support.
-
-
-%prep
-rm -rf $RPM_BUILD_ROOT
-%setup -q
-
-%build
-cd src
-%configure
-make all
-
-%install
-cd src
-%makeinstall
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%files
-%defattr(-,root,root,0755)
-%{_bindir}/gf
-%{_bindir}/gfdoc
-%doc LICENSE README doc/{DocGF.pdf,gf2-highlights.html,index.html}
-
-%files editor
-%defattr(-,root,root,0755)
-%{_bindir}/jgf
-%{_datadir}/%{name}-%{version}/gf-java.jar
-
-%files editor2
-%defattr(-,root,root,0755)
-%{_bindir}/gfeditor
-%{_datadir}/%{name}-%{version}/gfeditor.jar
-
-
-%changelog
-* Tue Jun 21 2005 Hans-Joachim Daniels <daniels@ira.uka.de> 2.3pre
-- added the printnames and HTML enhanced editor as editor2
-
-* Thu May 12 2005 Bjorn Bringert <bringert@cs.chalmers.se> 2.2pre2-1
-- Split package into gf and gf-editor packages.
-
-* Wed May 11 2005 Bjorn Bringert <bringert@cs.chalmers.se> 2.2pre1-1
-- Release of GF 2.2
-
-* Mon Nov 8 2004 Aarne Ranta <aarne@cs.chalmers.se> 2.1-1
-- Release of GF 2.1
-
-* Thu Jun 24 2004 Bjorn Bringert <bringert@cs.chalmers.se> 2.0-2
-- Set ownership correctly.
-- Move jar-file to share (thanks to Anders Carlsson for pointing this out.)
-- Added vendor tag.
-
-* Tue Jun 22 2004 Bjorn Bringert <bringert@cs.chalmers.se> 2.0-1
-- Include gfdoc binary
-
-* Mon Jun 21 2004 Bjorn Bringert <bringert@cs.chalmers.se> 2.0-1
-- Initial packaging
-
diff --git a/src/gf.wxs.in b/src/gf.wxs.in
deleted file mode 100644
index e2b21f12b..000000000
--- a/src/gf.wxs.in
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0"?>
-<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">
- <Product Id="4717AF5D-52AC-4D13-85E6-D87278CE9BBC"
- UpgradeCode="0BB7BB08-1A79-4981-A03F-32B401B01010"
- Name="Grammatical Framework, version @PACKAGE_VERSION@"
- Language="1033" Version="2.2" Manufacturer="The GF Developers">
- <Package Id="????????-????-????-????-????????????"
- Description="Grammatical Framework, version @PACKAGE_VERSION@"
- Comments="This package contains the Grammatical Framework system, version @PACKAGE_VERSION@."
- InstallerVersion="200" Compressed="yes" />
-
- <Media Id="1" Cabinet="gf.cab" EmbedCab="yes" />
-
- <Directory Id="TARGETDIR" Name="SourceDir">
-
- <Directory Id="ProgramFilesFolder">
- <Directory Id="INSTALLDIR" Name="GF-@PACKAGE_VERSION@">
-
- <Component Id="GFBinary" Guid="E2A44A6C-0252-4346-85AE-BC6A16BFB0FC" DiskId="1">
- <File Id="GFEXE" Name="gf.exe" src="../bin/gf.exe" />
- <Shortcut Id="GFStartMenu" Directory="GFProgramMenuDir"
- Name="GF" Target="[!GFEXE]" />
- </Component>
-
- <Component Id="GFDocBinary" Guid="BDCA6F34-EE0A-4E72-8D00-CB7CAF3CEAEA" DiskId="1">
- <File Id="GFDocEXE" Name="gfdoc.exe" src="tools/gfdoc.exe" />
- </Component>
-
- <Component Id="GFEditor" Guid="39F885F7-BC49-4CBC-9DCD-569C95AA3364" DiskId="1">
- <Environment Id="GFHomeEnv" Name="GF_HOME" Action="create" Part="all"
- Permanent="no" Value="[INSTALLDIR]" />
- <File Id="GFEditorBat" Name="jgf.bat" src="jgf.bat" />
- <File Id="GFEditorJar" Name="gf-java.jar" src="JavaGUI/gf-java.jar" />
- <Shortcut Id="GFEditorStartMenu" Directory="GFProgramMenuDir"
- Name="GFEditor" LongName="GF Editor" Target="[!GFEditorBat]"
- WorkingDirectory="INSTALLDIR" />
- </Component>
-
- <Directory Id="GFDocDir" Name="doc">
- <Component Id="GFDoc" Guid="23BEEBBF-F9AB-459F-B8D2-8414BB47834A" DiskId="1">
- <File Id="GFReadme" Name="README.txt" src="../README" />
- <File Id="GFLicenee" Name="LICENSE.txt" src="../LICENSE" />
- </Component>
- </Directory>
-
- </Directory>
- </Directory>
-
- <Directory Id="ProgramMenuFolder" Name="PMenu" LongName="Programs">
- <Directory Id="GFProgramMenuDir" Name='GF-@PACKAGE_VERSION@' />
- </Directory>
-
- </Directory>
-
- <Feature Id="ProductFeature" Title="Feature Title" Level="1">
- <ComponentRef Id="GFBinary" />
- <ComponentRef Id="GFDocBinary" />
- <ComponentRef Id="GFEditor" />
- <ComponentRef Id="GFDoc" />
- </Feature>
-
- </Product>
-</Wix> \ No newline at end of file
diff --git a/src/gf_atk.cfg b/src/gf_atk.cfg
deleted file mode 100644
index 37bb2c4f5..000000000
--- a/src/gf_atk.cfg
+++ /dev/null
@@ -1,98 +0,0 @@
-# GF ATK configuration file
-# ------------------------
-
-# -- Basic audio signal processing --
-
-SOURCEFORMAT = HAUDIO
-SOURCERATE = 625
-
-# Set in GF/System/ATKSpeechInput.hs
-# TARGETKIND = MFCC_0_D_A
-
-TARGETRATE = 100000.0
-WINDOWSIZE = 250000.0
-ENORMALISE = F
-ZMEANSOURCE = F
-USEHAMMING = T
-PREEMCOEF = 0.97
-USEPOWER = T
-NUMCHANS = 26
-CEPLIFTER = 22
-NUMCEPS = 12
-SILFLOOR = 50.0
-USESILDET = T
-MEASURESIL = F
-OUTSILWARN = T
-
-# -- Silence detection ---
-
-HPARM: CALWINDOW = 40
-HPARM: SPEECHTHRESH = 9.0
-HPARM: SILDISCARD = 10.0
-HPARM: SILENERGY = 0.0
-HPARM: SPCSEQCOUNT = 10
-HPARM: SPCGLCHCOUNT = 0
-HPARM: SILGLCHCOUNT = 2
-HPARM: SILSEQCOUNT = 50
-
-# -- Cepstral mean ---
-
-HPARM: CMNTCONST = 0.995
-HPARM: CMNRESETONSTOP = F
-HPARM: CMNMINFRAMES = 12
-
-# -- Recogniser --
-
-AREC: TRBAKFREQ = 1
-
-# hands free, don't return results until end
-AREC: RUNMODE = 01441
-
-AREC: GENBEAM = 200.0
-AREC: WORDBEAM = 175.0
-AREC: WORDPEN = -10.0
-
-HNET: FORCECXTEXP = T
-HNET: ALLOWXWRDEXP = F
-HNET: MARKSUBLAT = F
-ARMAN: AUTOSIL = F
-
-HREC: CONFSCALE = 0.15
-HREC: CONFOFFSET = 0.0
-#HREC: CONFBGHMM = bghmm
-
-# -- Set visibility and positions of ATK controls --
-
-AIN: DISPSHOW = T
-AIN: DISPXORIGIN = 440
-AIN: DISPYORIGIN = 220
-AIN: DISPHEIGHT = 40
-AIN: DISPWIDTH = 160
-
-ACODE: DISPSHOW = F
-ACODE: DISPXORIGIN = 40
-ACODE: DISPYORIGIN = 220
-ACODE: DISPHEIGHT = 220
-ACODE: DISPWIDTH = 380
-ACODE: MAXFGFEATS = 13
-ACODE: NUMSTREAMS = 1
-
-AREC: DISPSHOW = T
-AREC: DISPXORIGIN = 40
-AREC: DISPYORIGIN = 20
-AREC: DISPHEIGHT = 160
-AREC: DISPWIDTH = 560
-
-
-# -- Debugging --
-
-HMMSET: TRACE = 0
-ADICT: TRACE = 0
-AGRAM: TRACE = 0
-GGRAM: TRACE = 0
-AREC: TRACE = 0
-ARMAN: TRACE = 0
-HPARM: TRACE = 0
-HNET: TRACE = 0
-HREC: TRACE = 0
-
diff --git a/src/gfc.in b/src/gfc.in
deleted file mode 100644
index bd08db0b8..000000000
--- a/src/gfc.in
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-prefix="@prefix@"
-
-case "@host@" in
- *-cygwin)
- prefix=`cygpath -w "$prefix"`;;
-esac
-
-exec_prefix="@exec_prefix@"
-GF_BIN_DIR="@bindir@"
-GF_DATA_DIR="@datadir@/GF-@PACKAGE_VERSION@"
-
-GFBIN="$GF_BIN_DIR/gf"
-
-if [ ! -x "${GFBIN}" ]; then
- GF_BIN_DIR=`dirname $0`
- GFBIN="$GF_BIN_DIR/gf"
-fi
-
-if [ ! -x "${GFBIN}" ]; then
- GFBIN=`which gf`
-fi
-
-if [ ! -x "${GFBIN}" ]; then
- echo "gf not found."
- exit 1
-fi
-
-exec $GFBIN --batch "$@"
diff --git a/src/haddock/haddock-check.perl b/src/haddock/haddock-check.perl
deleted file mode 100644
index 93647bac7..000000000
--- a/src/haddock/haddock-check.perl
+++ /dev/null
@@ -1,169 +0,0 @@
-
-# checking that a file is haddocky:
-# - checking if it has an export list
-# - if there is no export list, it tries to find all defined functions
-# - checking that all exported functions have type signatures
-# - checking that the module header is OK
-
-# changes on files:
-# - transforming hard space to ordinary space
-
-# limitations:
-# - there might be some problems with nested comments
-# - cannot handle type signatures for several functions
-# (i.e. "a, b, c :: t")
-# but on the other hand -- haddock has some problems with these too...
-
-$operChar = qr/[\!\#\$\%\&\*\+\.\/\<\=\>\?\@\\\^\|\-\~]/;
-$operCharColon = qr/[\!\#\$\%\&\*\+\.\/\<\=\>\?\@\\\^\|\-\~\:]/;
-$nonOperChar = qr/[^\!\#\$\%\&\*\+\.\/\<\=\>\?\@\\\^\|\-\~]/;
-$nonOperCharColon = qr/[^\!\#\$\%\&\*\+\.\/\<\=\>\?\@\\\^\|\-\~\:]/;
-
-$operSym = qr/$operChar $operCharColon*/x;
-$funSym = qr/[a-z] \w* \'*/x;
-$funOrOper = qr/(?: $funSym | \($operSym\) )/x;
-
-$keyword = qr/(?: type | data | module | newtype | infix[lr]? | import | instance | class )/x;
-$keyOper = qr/^(?: \.\. | \:\:? | \= | \\ | \| | \<\- | \-\> | \@ | \~ | \=\> | \. )$/x;
-
-sub check_headerline {
- my ($title, $regexp) = @_;
- if (s/^-- \s $title \s* : \s+ (.+?) \s*\n//sx) {
- $name = $1;
- push @ERR, "Incorrect ".lcfirst $title.": $name"
- unless $name =~ $regexp;
- return $&;
- } else {
- push @ERR, "Header missing: ".lcfirst $title."";
- }
-}
-
-if ($#ARGV >= 0) {
- @FILES = @ARGV;
-} else {
-# @dirs = qw{. api canonical cf cfgm compile for-ghc-nofud
-# grammar infra notrace parsers shell
-# source speech translate useGrammar util visualization
-# GF GF/* GF/*/* GF/*/*/*};
- @dirs = qw{GF GF/* GF/*/* GF/*/*/*};
- @FILES = grep(!/\/(Par|Lex)(GF|GFC|CFG)\.hs$/,
- glob "{".join(",",@dirs)."}/*.hs");
-}
-
-for $file (@FILES) {
- $file =~ s/\.hs//;
-
- open F, "<$file.hs";
- $_ = join "", <F>;
- close F;
-
- @ERR = ();
-
- # substituting hard spaces for ordinary spaces
- $nchars = tr/\240/ /;
- if ($nchars > 0) {
- push @ERR, "!! > Substituted $nchars hard spaces";
- open F, ">$file.hs";
- print F $_;
- close F;
- }
-
- # the module header
- $hdr_module = $module = "";
-
- s/^ \{-\# \s+ OPTIONS \s+ -cpp \s+ \#-\} //sx; # removing ghc options (cpp)
- s/^ \s+ //sx; # removing initial whitespace
- s/^ (--+ \s* \n) +//sx; # removing initial comment lines
- unless (s/^ -- \s \| \s* \n//sx) {
- push @ERR, "Incorrect module header";
- } else {
- $hdr_module = s/^-- \s Module \s* : \s+ (.+?) \s*\n//sx ? $1 : "";
- &check_headerline("Maintainer", qr/^ [\wåäöÅÄÖüÜ\s\@\.]+ $/x);
- &check_headerline("Stability", qr/.*/);
- &check_headerline("Portability", qr/.*/);
- s/^ (--+ \s* \n) +//sx;
- push @ERR, "Missing CVS information"
- unless s/^(-- \s+ \> \s+ CVS \s+ \$ .*? \$ \s* \n)+//sx;
- s/^ (--+ \s* \n) +//sx;
- push @ERR, "Missing module description"
- unless /^ -- \s+ [^\(]/x;
- }
-
- # removing comments
- s/\{- .*? -\}//gsx;
- s/-- ($nonOperSymColon .*? \n | \n)/\n/gx;
-
- # removing \n in front of whitespace (for simplification)
- s/\n+[ \t]/ /gs;
-
- # the export list
- $exportlist = "";
-
- if (/\n module \s+ ((?: \w | \.)+) \s+ \( (.*?) \) \s+ where/sx) {
- ($module, $exportlist) = ($1, $2);
-
- $exportlist =~ s/\b module \s+ [A-Z] \w*//gsx;
- $exportlist =~ s/\(\.\.\)//g;
-
- } elsif (/\n module \s+ ((?: \w | \.)+) \s+ where/sx) {
- $module = $1;
-
- # modules without export lists
- # push @ERR, "No export list";
-
- # function definitions
- while (/^ (.*? $nonOperCharColon) = (?! $operCharColon)/gmx) {
- $defn = $1;
- next if $defn =~ /^ $keyword \b/x;
-
- if ($defn =~ /\` ($funSym) \`/x) {
- $fn = $1;
- } elsif ($defn =~ /(?<! $operCharColon) ($operSym)/x
- && $1 !~ $keyOper) {
- $fn = "($1)";
- } elsif ($defn =~ /^($funSym)/x) {
- $fn = $1;
- } else {
- push @ERR, "!! > Error in function defintion: $defn";
- next;
- }
-
- $exportlist .= " $fn ";
- }
- } else {
- push @ERR, "No module header found";
- }
-
- push @ERR, "Module names not matching: $module != $hdr_module"
- if $hdr_module && $module !~ /\Q$hdr_module\E$/;
-
- # fixing exportlist (double spaces as separator)
- $exportlist = " $exportlist ";
- $exportlist =~ s/(\s | \,)+/ /gx;
-
- # removing functions with type signatures from export list
- while (/^ ($funOrOper (\s* , \s* $funOrOper)*) \s* ::/gmx) {
- $functionlist = $1;
- while ($functionlist =~ s/^ ($funOrOper) (\s* , \s*)?//x) {
- $function = $1;
- $exportlist =~ s/\s \Q$function\E \s/ /gx;
- }
- }
-
- # reporting exported functions without type signatures
- $reported = 0;
- $untyped = "";
- while ($exportlist =~ /\s ($funOrOper) \s/x) {
- $function = $1;
- $exportlist =~ s/\s \Q$function\E \s/ /gx;
- $reported++;
- $untyped .= " $function";
- }
- push @ERR, "No type signature for $reported function(s):\n " . $untyped
- if $reported;
-
- print "-- $file\n > " . join("\n > ", @ERR) . "\n"
- if @ERR;
-}
-
-
diff --git a/src/haddock/haddock-script.csh b/src/haddock/haddock-script.csh
deleted file mode 100644
index 77b3761f8..000000000
--- a/src/haddock/haddock-script.csh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/tcsh
-
-######################################################################
-# Author: Peter Ljunglöf
-# Time-stamp: "2005-05-12, 23:17"
-# CVS $Date: 2005/05/13 12:40:20 $
-# CVS $Author: peb $
-#
-# a script for producing documentation through Haddock
-######################################################################
-
-set basedir = `pwd`
-set docdir = haddock/html
-set tempdir = haddock/.temp-files
-set resourcedir = haddock/resources
-
-set files = (`find GF -name '*.hs'` GF.hs)
-
-######################################################################
-
-echo 1. Creating and cleaning Haddock directory
-echo -- $docdir
-
-mkdir -p $docdir
-rm -rf $docdir/*
-
-######################################################################
-
-echo
-echo 2. Copying Haskell files to temporary directory: $tempdir
-
-rm -rf $tempdir
-
-foreach f ($files)
- # echo -- $f
- mkdir -p `dirname $tempdir/$f`
- perl -pe 's/^#/-- CPP #/' $f > $tempdir/$f
-end
-
-######################################################################
-
-echo
-echo 3. Invoking Haddock
-
-cd $tempdir
-haddock -o $basedir/$docdir -h -t 'Grammatical Framework' $files
-cd $basedir
-
-######################################################################
-
-echo
-echo 4. Restructuring to HTML framesets
-
-echo -- Substituting for frame targets inside html files
-mv $docdir/index.html $docdir/index-frame.html
-foreach f ($docdir/*.html)
- # echo -- $f
- perl -pe 's/<HEAD/<HEAD><BASE TARGET="contents"/; s/"index.html"/"index-frame.html"/; s/(<A HREF = "\S*index\S*.html")/$1 TARGET="index"/' $f > .tempfile
- mv .tempfile $f
-end
-
-echo -- Copying resource files:
-echo -- `ls $resourcedir/*.*`
-cp $resourcedir/*.* $docdir
-
-######################################################################
-
-echo
-echo 5. Finished
-echo -- The documentation is located at:
-echo -- $docdir/index.html
-
-
diff --git a/src/haddock/resources/blank.html b/src/haddock/resources/blank.html
deleted file mode 100644
index 63ab0b172..000000000
--- a/src/haddock/resources/blank.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-
-<!-- Time-stamp: "2005-02-03, 15:59" -->
-<HTML>
-<HEAD>
-<LINK HREF="haddock.css" REL=stylesheet>
-</HEAD>
-<BODY>
-</BODY>
-</HTML>
diff --git a/src/haddock/resources/index.html b/src/haddock/resources/index.html
deleted file mode 100644
index 5d8822dc5..000000000
--- a/src/haddock/resources/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
- "http://www.w3.org/TR/html4/frameset.dtd">
-
-<!-- Time-stamp: "2005-02-03, 15:53" -->
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
-<title>Grammatical Framework programmer's documentation</title>
-</head>
-<frameset cols="1*,2*">
- <frame name="index" src="index-frame.html">
- <frame name="contents" src="blank.html">
-</frameset>
-</html>
diff --git a/src/install-sh b/src/install-sh
deleted file mode 100644
index e9de23842..000000000
--- a/src/install-sh
+++ /dev/null
@@ -1,251 +0,0 @@
-#!/bin/sh
-#
-# install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
-#
-# Copyright 1991 by the Massachusetts Institute of Technology
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission. M.I.T. makes no representations about the
-# suitability of this software for any purpose. It is provided "as is"
-# without express or implied warranty.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch. It can only install one file at a time, a restriction
-# shared with many OS's install programs.
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd="$cpprog"
- shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd="$stripprog"
- shift
- continue;;
-
- -t=*) transformarg=`echo $1 | sed 's/-t=//'`
- shift
- continue;;
-
- -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- # this colon is to work around a 386BSD /bin/sh bug
- :
- dst=$1
- fi
- shift
- continue;;
- esac
-done
-
-if [ x"$src" = x ]
-then
- echo "install: no input file specified"
- exit 1
-else
- true
-fi
-
-if [ x"$dir_arg" != x ]; then
- dst=$src
- src=""
-
- if [ -d $dst ]; then
- instcmd=:
- chmodcmd=""
- else
- instcmd=mkdir
- fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
-# if $src (and thus $dsttmp) contains '*'.
-
- if [ -f $src -o -d $src ]
- then
- true
- else
- echo "install: $src does not exist"
- exit 1
- fi
-
- if [ x"$dst" = x ]
- then
- echo "install: no destination specified"
- exit 1
- else
- true
- fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
- if [ -d $dst ]
- then
- dst="$dst"/`basename $src`
- else
- true
- fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-# this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
- pathcomp="${pathcomp}${1}"
- shift
-
- if [ ! -d "${pathcomp}" ] ;
- then
- $mkdirprog "${pathcomp}"
- else
- true
- fi
-
- pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
- $doit $instcmd $dst &&
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
- if [ x"$transformarg" = x ]
- then
- dstfile=`basename $dst`
- else
- dstfile=`basename $dst $transformbasename |
- sed $transformarg`$transformbasename
- fi
-
-# don't allow the sed command to completely eliminate the filename
-
- if [ x"$dstfile" = x ]
- then
- dstfile=`basename $dst`
- else
- true
- fi
-
-# Make a temp file name in the proper directory.
-
- dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
- $doit $instcmd $src $dsttmp &&
-
- trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing. If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
- $doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
-
-fi &&
-
-
-exit 0
diff --git a/src/runtime/c/Makefile b/src/runtime/c/Makefile
new file mode 100644
index 000000000..72ac7ea79
--- /dev/null
+++ b/src/runtime/c/Makefile
@@ -0,0 +1,19 @@
+CC = gcc
+CFLAGS += -O2 -W -Wall
+
+.PHONY: all clean
+
+all: libgfcc.a
+
+libgfcc.a: gfcc-tree.o gfcc-term.o
+ ar r $@ $^
+
+gfcc-tree.o: gfcc-tree.c gfcc-tree.h
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+gfcc-term.o: gfcc-term.c gfcc-term.h
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+clean:
+ -rm -f libgfcc.a
+ -rm -f *.o
diff --git a/src/runtime/c/gfcc-term.c b/src/runtime/c/gfcc-term.c
new file mode 100644
index 000000000..b427479e6
--- /dev/null
+++ b/src/runtime/c/gfcc-term.c
@@ -0,0 +1,203 @@
+#include "gfcc-term.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+static void *buffer = NULL;
+static size_t current;
+
+extern void term_alloc_pool(size_t size) {
+ if (buffer == NULL)
+ buffer = malloc(size);
+ current = 0;
+}
+
+extern void term_free_pool() {
+ if (buffer != NULL)
+ free(buffer);
+ buffer = NULL;
+}
+
+extern void *term_alloc(size_t size) {
+ void *off = buffer + current;
+ current += size;
+ return off;
+}
+
+static inline Term *create_term(TermType type, int n) {
+ Term *t = (Term*)term_alloc(sizeof(Term) + n * sizeof(Term *));
+ t->type = type;
+ t->value.size = n; /* FIXME: hack! */
+ return t;
+}
+
+extern Term *term_array(int n, ...) {
+ Term *t = create_term(TERM_ARRAY, n);
+ va_list ap;
+ int i;
+
+ va_start(ap, n);
+ for (i = 0; i < n; i++) {
+ term_set_child(t, i, va_arg(ap, Term *));
+ }
+ va_end(ap);
+
+ return t;
+}
+
+extern Term *term_seq(int n, ...) {
+ Term *t = create_term(TERM_SEQUENCE, n);
+ va_list ap;
+ int i;
+
+ va_start(ap, n);
+ for (i = 0; i < n; i++) {
+ term_set_child(t, i, va_arg(ap, Term *));
+ }
+ va_end(ap);
+
+ return t;
+}
+
+extern Term *term_variants(int n, ...) {
+ Term *t = create_term(TERM_VARIANTS, n);
+ va_list ap;
+ int i;
+
+ va_start(ap, n);
+ for (i = 0; i < n; i++) {
+ term_set_child(t, i, va_arg(ap, Term *));
+ }
+ va_end(ap);
+
+ return t;
+}
+
+extern Term *term_glue(int n, ...) {
+ Term *t = create_term(TERM_GLUE, n);
+ va_list ap;
+ int i;
+
+ va_start(ap, n);
+ for (i = 0; i < n; i++) {
+ term_set_child(t, i, va_arg(ap, Term *));
+ }
+ va_end(ap);
+
+ return t;
+}
+
+extern Term *term_rp(Term *t1, Term *t2) {
+ Term *t = create_term(TERM_RECORD_PARAM, 2);
+ term_set_child(t, 0, t1);
+ term_set_child(t, 1, t2);
+ return t;
+}
+
+extern Term *term_suffix(const char *pref, Term *suf) {
+ Term *t = create_term(TERM_SUFFIX_TABLE, 2);
+ term_set_child(t,0,term_str(pref));
+ term_set_child(t,1,suf);
+ return t;
+}
+
+extern Term *term_str(const char *s) {
+ Term *t = create_term(TERM_STRING, 0);
+ t->value.string_value = s;
+ return t;
+}
+
+extern Term *term_int(int i) {
+ Term *t = create_term(TERM_INTEGER,0);
+ t->value.integer_value = i;
+ return t;
+}
+
+extern Term *term_meta() {
+ return create_term(TERM_META, 0);
+}
+
+
+
+extern Term *term_sel_int(Term *t, int i) {
+ switch (t->type) {
+ case TERM_ARRAY:
+ return term_get_child(t,i);
+ case TERM_SUFFIX_TABLE:
+ return term_glue(2,
+ term_get_child(t,0),
+ term_sel_int(term_get_child(t,1),i));
+ case TERM_META:
+ return t;
+ default:
+ fprintf(stderr,"Error: term_sel_int %d %d\n", t->type, i);
+ exit(1);
+ return NULL;
+ }
+}
+
+extern Term *term_sel(Term *t1, Term *t2) {
+ switch (t2->type) {
+ case TERM_INTEGER:
+ return term_sel_int(t1, t2->value.integer_value);
+ case TERM_RECORD_PARAM:
+ return term_sel(t1,term_get_child(t2,0));
+ case TERM_META:
+ return term_sel_int(t1,0);
+ default:
+ fprintf(stderr,"Error: term_sel %d %d\n", t1->type, t2->type);
+ exit(1);
+ return 0;
+ }
+}
+
+
+
+static void term_print_sep(FILE *stream, Term *t, const char *sep) {
+ int n = t->value.size;
+ int i;
+
+ for (i = 0; i < n; i++) {
+ term_print(stream, term_get_child(t,i));
+ if (i < n-1) {
+ fputs(sep, stream);
+ }
+ }
+}
+
+extern void term_print(FILE *stream, Term *t) {
+ switch (t->type) {
+ case TERM_ARRAY:
+ term_print(stream, term_get_child(t,0));
+ break;
+ case TERM_SEQUENCE:
+ term_print_sep(stream, t, " ");
+ break;
+ case TERM_VARIANTS:
+ term_print_sep(stream, t, "/");
+ break;
+ case TERM_GLUE:
+ term_print_sep(stream, t, "");
+ break;
+ case TERM_RECORD_PARAM:
+ term_print(stream, term_get_child(t,0));
+ break;
+ case TERM_SUFFIX_TABLE:
+ term_print(stream, term_get_child(t,0));
+ term_print(stream, term_get_child(t,1));
+ break;
+ case TERM_META:
+ fputs("?", stream);
+ break;
+ case TERM_STRING:
+ fputs(t->value.string_value, stream);
+ break;
+ case TERM_INTEGER:
+ fprintf(stream, "%d", t->value.integer_value);
+ break;
+ default:
+ fprintf(stderr,"Error: term_print %d\n", t->type);
+ exit(1);
+ }
+}
diff --git a/src/runtime/c/gfcc-term.h b/src/runtime/c/gfcc-term.h
new file mode 100644
index 000000000..d1307259d
--- /dev/null
+++ b/src/runtime/c/gfcc-term.h
@@ -0,0 +1,65 @@
+#ifndef GFCC_TERM_H
+#define GFCC_TERM_H
+
+#include <stdio.h>
+
+typedef enum {
+ /* size = variable */
+ TERM_ARRAY,
+ TERM_SEQUENCE,
+ TERM_VARIANTS,
+ TERM_GLUE,
+ /* size = 2 */
+ TERM_RECORD_PARAM,
+ TERM_SUFFIX_TABLE,
+ /* size = 0 */
+ TERM_META,
+ TERM_STRING,
+ TERM_INTEGER
+} TermType;
+
+struct Term_ {
+ TermType type;
+ union {
+ const char *string_value;
+ int integer_value;
+ int size;
+ } value;
+ struct Term_ *args[0];
+};
+
+typedef struct Term_ Term;
+
+
+
+static inline Term *term_get_child(Term *t, int n) {
+ return t->args[n];
+}
+
+static inline void term_set_child(Term *t, int n, Term *c) {
+ t->args[n] = c;
+}
+
+extern void term_alloc_pool(size_t size);
+extern void term_free_pool();
+extern void *term_alloc(size_t size);
+
+
+extern Term *term_array(int n, ...);
+extern Term *term_seq(int n, ...);
+extern Term *term_variants(int n, ...);
+extern Term *term_glue(int n, ...);
+
+extern Term *term_rp(Term *t1, Term *t2);
+extern Term *term_suffix(const char *pref, Term *suf);
+extern Term *term_str(const char *s);
+extern Term *term_int(int i);
+extern Term *term_meta();
+
+extern Term *term_sel_int(Term *t, int i);
+extern Term *term_sel(Term *t1, Term *t2);
+
+
+extern void term_print(FILE *stream, Term *t);
+
+#endif
diff --git a/src/runtime/c/gfcc-tree.c b/src/runtime/c/gfcc-tree.c
new file mode 100644
index 000000000..6cd8759be
--- /dev/null
+++ b/src/runtime/c/gfcc-tree.c
@@ -0,0 +1,61 @@
+#include "gfcc-tree.h"
+
+#include <stdlib.h>
+
+
+extern int arity(Tree *t) {
+ switch (t->type) {
+ case ATOM_STRING:
+ case ATOM_INTEGER:
+ case ATOM_DOUBLE:
+ case ATOM_META:
+ return 0;
+ default:
+ return t->value.size;
+ }
+}
+
+static Tree *create_tree(atom_type c, int n) {
+ Tree *t = (Tree *)malloc(sizeof(Tree) + n * sizeof(Tree *));
+ t->type = c;
+ return t;
+}
+
+extern Tree *tree_string(const char *s) {
+ Tree *t = create_tree(ATOM_STRING, 0);
+ t->value.string_value = s;
+ return t;
+}
+
+extern Tree *tree_integer(int i) {
+ Tree *t = create_tree(ATOM_INTEGER, 0);
+ t->value.integer_value = i;
+ return t;
+}
+
+extern Tree *tree_double(double d) {
+ Tree *t = create_tree(ATOM_DOUBLE, 0);
+ t->value.double_value = d;
+ return t;
+}
+
+extern Tree *tree_meta() {
+ return create_tree(ATOM_META, 0);
+}
+
+extern Tree *tree_fun(atom_type f, int n) {
+ Tree *t = create_tree(f, n);
+ t->value.size = n;
+ return t;
+}
+
+
+extern void tree_free(Tree *t) {
+ int n = arity(t);
+ int i;
+
+ for (i = 0; i < n; i++) {
+ tree_free(tree_get_child(t,i));
+ }
+ free(t);
+}
diff --git a/src/runtime/c/gfcc-tree.h b/src/runtime/c/gfcc-tree.h
new file mode 100644
index 000000000..cc8f0fcab
--- /dev/null
+++ b/src/runtime/c/gfcc-tree.h
@@ -0,0 +1,49 @@
+#ifndef GFCC_TREE_H
+#define GFCC_TREE_H
+
+typedef enum {
+ ATOM_STRING,
+ ATOM_INTEGER,
+ ATOM_DOUBLE,
+ ATOM_META,
+ ATOM_FIRST_FUN
+} atom_type;
+
+struct Tree_{
+ atom_type type;
+ union {
+ const char *string_value;
+ int integer_value;
+ double double_value;
+ int size;
+ } value;
+ struct Tree_ *args[0];
+};
+
+typedef struct Tree_ Tree;
+
+static inline Tree *tree_get_child(Tree *t, int n) {
+ return t->args[n];
+}
+
+static inline void tree_set_child(Tree *t, int n, Tree *a) {
+ t->args[n] = a;
+}
+
+extern int arity(Tree *t);
+
+
+extern Tree *tree_string(const char *s);
+
+extern Tree *tree_integer(int i);
+
+extern Tree *tree_double(double d);
+
+extern Tree *tree_meta();
+
+extern Tree *tree_fun(atom_type f, int n);
+
+
+extern void tree_free(Tree *t);
+
+#endif
diff --git a/src/Data/Binary.hs b/src/runtime/haskell/Data/Binary.hs
index 786f5a09e..786f5a09e 100644
--- a/src/Data/Binary.hs
+++ b/src/runtime/haskell/Data/Binary.hs
diff --git a/src/Data/Binary/Builder.hs b/src/runtime/haskell/Data/Binary/Builder.hs
index cccbe6fa4..cccbe6fa4 100644
--- a/src/Data/Binary/Builder.hs
+++ b/src/runtime/haskell/Data/Binary/Builder.hs
diff --git a/src/Data/Binary/Get.hs b/src/runtime/haskell/Data/Binary/Get.hs
index 51062ad31..51062ad31 100644
--- a/src/Data/Binary/Get.hs
+++ b/src/runtime/haskell/Data/Binary/Get.hs
diff --git a/src/Data/Binary/Put.hs b/src/runtime/haskell/Data/Binary/Put.hs
index a1f78dfba..a1f78dfba 100644
--- a/src/Data/Binary/Put.hs
+++ b/src/runtime/haskell/Data/Binary/Put.hs
diff --git a/src/PGF.hs b/src/runtime/haskell/PGF.hs
index 6c192095d..6c192095d 100644
--- a/src/PGF.hs
+++ b/src/runtime/haskell/PGF.hs
diff --git a/src/PGF/Binary.hs b/src/runtime/haskell/PGF/Binary.hs
index e4ed98424..e4ed98424 100644
--- a/src/PGF/Binary.hs
+++ b/src/runtime/haskell/PGF/Binary.hs
diff --git a/src/PGF/BuildParser.hs b/src/runtime/haskell/PGF/BuildParser.hs
index 23e0725c6..23e0725c6 100644
--- a/src/PGF/BuildParser.hs
+++ b/src/runtime/haskell/PGF/BuildParser.hs
diff --git a/src/PGF/CId.hs b/src/runtime/haskell/PGF/CId.hs
index fea304d9d..fea304d9d 100644
--- a/src/PGF/CId.hs
+++ b/src/runtime/haskell/PGF/CId.hs
diff --git a/src/PGF/Check.hs b/src/runtime/haskell/PGF/Check.hs
index 58b66cfe4..58b66cfe4 100644
--- a/src/PGF/Check.hs
+++ b/src/runtime/haskell/PGF/Check.hs
diff --git a/src/PGF/Data.hs b/src/runtime/haskell/PGF/Data.hs
index 38027e96e..38027e96e 100644
--- a/src/PGF/Data.hs
+++ b/src/runtime/haskell/PGF/Data.hs
diff --git a/src/PGF/Editor.hs b/src/runtime/haskell/PGF/Editor.hs
index 3f69da170..3f69da170 100644
--- a/src/PGF/Editor.hs
+++ b/src/runtime/haskell/PGF/Editor.hs
diff --git a/src/PGF/Expr.hs b/src/runtime/haskell/PGF/Expr.hs
index cf0cb79aa..cf0cb79aa 100644
--- a/src/PGF/Expr.hs
+++ b/src/runtime/haskell/PGF/Expr.hs
diff --git a/src/PGF/Expr.hs-boot b/src/runtime/haskell/PGF/Expr.hs-boot
index 34a62a410..34a62a410 100644
--- a/src/PGF/Expr.hs-boot
+++ b/src/runtime/haskell/PGF/Expr.hs-boot
diff --git a/src/PGF/Generate.hs b/src/runtime/haskell/PGF/Generate.hs
index 5add00a78..5add00a78 100644
--- a/src/PGF/Generate.hs
+++ b/src/runtime/haskell/PGF/Generate.hs
diff --git a/src/PGF/Linearize.hs b/src/runtime/haskell/PGF/Linearize.hs
index fdd4cecb5..fdd4cecb5 100644
--- a/src/PGF/Linearize.hs
+++ b/src/runtime/haskell/PGF/Linearize.hs
diff --git a/src/PGF/Macros.hs b/src/runtime/haskell/PGF/Macros.hs
index af25de025..af25de025 100644
--- a/src/PGF/Macros.hs
+++ b/src/runtime/haskell/PGF/Macros.hs
diff --git a/src/PGF/Morphology.hs b/src/runtime/haskell/PGF/Morphology.hs
index 9eee71a97..9eee71a97 100644
--- a/src/PGF/Morphology.hs
+++ b/src/runtime/haskell/PGF/Morphology.hs
diff --git a/src/PGF/PMCFG.hs b/src/runtime/haskell/PGF/PMCFG.hs
index c657e3d17..c657e3d17 100644
--- a/src/PGF/PMCFG.hs
+++ b/src/runtime/haskell/PGF/PMCFG.hs
diff --git a/src/PGF/Paraphrase.hs b/src/runtime/haskell/PGF/Paraphrase.hs
index 58d15b2e8..58d15b2e8 100644
--- a/src/PGF/Paraphrase.hs
+++ b/src/runtime/haskell/PGF/Paraphrase.hs
diff --git a/src/PGF/Parsing/FCFG/Active.hs b/src/runtime/haskell/PGF/Parsing/FCFG/Active.hs
index e88926f6e..e88926f6e 100644
--- a/src/PGF/Parsing/FCFG/Active.hs
+++ b/src/runtime/haskell/PGF/Parsing/FCFG/Active.hs
diff --git a/src/PGF/Parsing/FCFG/Incremental.hs b/src/runtime/haskell/PGF/Parsing/FCFG/Incremental.hs
index 296a0d33b..296a0d33b 100644
--- a/src/PGF/Parsing/FCFG/Incremental.hs
+++ b/src/runtime/haskell/PGF/Parsing/FCFG/Incremental.hs
diff --git a/src/PGF/Parsing/FCFG/Utilities.hs b/src/runtime/haskell/PGF/Parsing/FCFG/Utilities.hs
index dc0b2dc4a..dc0b2dc4a 100644
--- a/src/PGF/Parsing/FCFG/Utilities.hs
+++ b/src/runtime/haskell/PGF/Parsing/FCFG/Utilities.hs
diff --git a/src/PGF/ShowLinearize.hs b/src/runtime/haskell/PGF/ShowLinearize.hs
index dd3b997a6..dd3b997a6 100644
--- a/src/PGF/ShowLinearize.hs
+++ b/src/runtime/haskell/PGF/ShowLinearize.hs
diff --git a/src/PGF/Tree.hs b/src/runtime/haskell/PGF/Tree.hs
index cb2052cd7..cb2052cd7 100644
--- a/src/PGF/Tree.hs
+++ b/src/runtime/haskell/PGF/Tree.hs
diff --git a/src/PGF/Type.hs b/src/runtime/haskell/PGF/Type.hs
index 013754a45..013754a45 100644
--- a/src/PGF/Type.hs
+++ b/src/runtime/haskell/PGF/Type.hs
diff --git a/src/PGF/TypeCheck.hs b/src/runtime/haskell/PGF/TypeCheck.hs
index 937c21786..937c21786 100644
--- a/src/PGF/TypeCheck.hs
+++ b/src/runtime/haskell/PGF/TypeCheck.hs
diff --git a/src/PGF/VisualizeTree.hs b/src/runtime/haskell/PGF/VisualizeTree.hs
index 429551f54..429551f54 100644
--- a/src/PGF/VisualizeTree.hs
+++ b/src/runtime/haskell/PGF/VisualizeTree.hs
diff --git a/src/runtime/javascript/editor.html b/src/runtime/javascript/editor.html
new file mode 100644
index 000000000..dd189d9ab
--- /dev/null
+++ b/src/runtime/javascript/editor.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <link rel="stylesheet" type="text/css" href="style.css" />
+ <script type="text/javascript" src="gflib.js"></script>
+ <script type="text/javascript" src="editorGrammar.js"></script>
+ <script type="text/javascript" src="grammar.js"></script>
+ <script type="text/javascript" src="gfjseditor.js"></script>
+ <title>Web-based Syntax Editor</title>
+ </head>
+ <body onload="mkEditor('editor', Food)" onkeydown="hotKeys(event)">
+ <div id="editor">
+ </div>
+ </body>
+</html>
diff --git a/src/runtime/javascript/editorGrammar.js b/src/runtime/javascript/editorGrammar.js
new file mode 100644
index 000000000..a4cc01ea5
--- /dev/null
+++ b/src/runtime/javascript/editorGrammar.js
@@ -0,0 +1 @@
+var Editor = new GFGrammar(new GFAbstract("Sentence",{Available: new Type([], "Adjective"), Bulgarian: new Type([], "Noun"), Command: new Type(["Verb", "Determiner", "Noun"], "Sentence"), CommandAdj: new Type(["Verb", "Determiner", "Adjective", "Noun"], "Sentence"), Copy: new Type([], "Verb"), Cut: new Type([], "Verb"), Danish: new Type([], "Noun"), DefPlDet: new Type([], "Determiner"), DefSgDet: new Type([], "Determiner"), Delete: new Type([], "Verb"), English: new Type([], "Noun"), Enter: new Type([], "Verb"), ErrorMessage: new Type(["Adjective", "Noun"], "Sentence"), Finnish: new Type([], "Noun"), Float_N: new Type([], "Noun"), French: new Type([], "Noun"), German: new Type([], "Noun"), IndefPlDet: new Type([], "Determiner"), IndefSgDet: new Type([], "Determiner"), Integer_N: new Type([], "Noun"), Italian: new Type([], "Noun"), Label: new Type(["Noun"], "Sentence"), Language: new Type([], "Noun"), Next: new Type([], "Adjective"), Node: new Type([], "Noun"), Norwegian: new Type([], "Noun"), Page: new Type([], "Noun"), Parse: new Type([], "Verb"), Paste: new Type([], "Verb"), Previous: new Type([], "Adjective"), RandomlyCommand: new Type(["Verb", "Determiner", "Noun"], "Sentence"), Redo: new Type([], "Verb"), Refine: new Type([], "Verb"), Refinement: new Type([], "Noun"), Replace: new Type([], "Verb"), Russian: new Type([], "Noun"), Select: new Type([], "Verb"), Show: new Type([], "Verb"), SingleWordCommand: new Type(["Verb"], "Sentence"), Spanish: new Type([], "Noun"), String_N: new Type([], "Noun"), Swedish: new Type([], "Noun"), Tree: new Type([], "Noun"), Undo: new Type([], "Verb"), Wrap: new Type([], "Verb"), Wrapper: new Type([], "Noun")}),{EditorEng: new GFConcrete({coding: "utf8"},{Available: function(cs){return new Arr(new Suffix("available", new Arr(new Str(""), new Str("r"), new Str("st"), new Str("ly"))));}, Bulgarian: function(cs){return new Arr(new Arr(Editor.concretes["EditorEng"].rule("_4", cs), Editor.concretes["EditorEng"].rule("_4", cs)), new Int(0));}, Command: function(cs){return new Arr(new Seq(Editor.concretes["EditorEng"].rule("_8", cs), Editor.concretes["EditorEng"].rule("_11", cs), Editor.concretes["EditorEng"].rule("_14", cs), Editor.concretes["EditorEng"].rule("_18", cs)));}, CommandAdj: function(cs){return new Arr(new Seq(Editor.concretes["EditorEng"].rule("_8", cs), Editor.concretes["EditorEng"].rule("_11", cs),(new Arr(Editor.concretes["EditorEng"].rule("_13", cs), Editor.concretes["EditorEng"].rule("_13", cs), Editor.concretes["EditorEng"].rule("_13", cs), Editor.concretes["EditorEng"].rule("_13", cs), Editor.concretes["EditorEng"].rule("_13", cs), Editor.concretes["EditorEng"].rule("_13", cs), Editor.concretes["EditorEng"].rule("_13", cs), Editor.concretes["EditorEng"].rule("_13", cs))).sel(Editor.concretes["EditorEng"].rule("_22", cs).sel(cs[3].sel(new Int(1)))), cs[3].sel(new Int(0)).sel(new Int(0)).sel(new Int(1)), Editor.concretes["EditorEng"].rule("_18", cs)));}, Copy: function(cs){return new Arr(new Suffix("Cop", new Arr(new Str("y"), new Str("ies"), new Str("ied"), new Str("ying"))), new Int(1));}, Cut: function(cs){return new Arr(new Suffix("Cut", Editor.concretes["EditorEng"].rule("_34", cs)), new Int(1));}, Danish: function(cs){return new Arr(new Arr(Editor.concretes["EditorEng"].rule("_37", cs), Editor.concretes["EditorEng"].rule("_37", cs)), new Int(0));}, DefPlDet: function(cs){return Editor.concretes["EditorEng"].rule("_43", cs);}, DefSgDet: function(cs){return Editor.concretes["EditorEng"].rule("_43", cs);}, Delete: function(cs){return new Arr(new Suffix("Delet", Editor.concretes["EditorEng"].rule("_44", cs)), new Int(1));}, English: function(cs){return new Arr(new Arr(Editor.concretes["EditorEng"].rule("_47", cs), Editor.concretes["EditorEng"].rule("_47", cs)), new Int(0));}, Enter: function(cs){return new Arr(new Suffix("Enter", Editor.concretes["EditorEng"].rule("_34", cs)), new Int(1));}, ErrorMessage: function(cs){return new Arr(new Seq(new Str("there"),(new Arr(new Seq(new Str("am"), new Str("not")), new Str("aren't"), new Str("aren't"), new Str("aren't"), new Str("isn't"), new Str("isn't"), new Str("isn't"), new Str("aren't"))).sel(Editor.concretes["EditorEng"].rule("_59", cs)), Editor.concretes["EditorEng"].rule("_62", cs), Editor.concretes["EditorEng"].rule("_62", cs), Editor.concretes["EditorEng"].rule("_62", cs),(new Arr(Editor.concretes["EditorEng"].rule("_67", cs), Editor.concretes["EditorEng"].rule("_67", cs), Editor.concretes["EditorEng"].rule("_67", cs), Editor.concretes["EditorEng"].rule("_67", cs), Editor.concretes["EditorEng"].rule("_67", cs), Editor.concretes["EditorEng"].rule("_67", cs), Editor.concretes["EditorEng"].rule("_67", cs), Editor.concretes["EditorEng"].rule("_67", cs))).sel(Editor.concretes["EditorEng"].rule("_59", cs))));}, Finnish: function(cs){return new Arr(new Arr(Editor.concretes["EditorEng"].rule("_72", cs), Editor.concretes["EditorEng"].rule("_72", cs)), new Int(0));}, Float_N: function(cs){return new Arr(new Arr(new Suffix("float", Editor.concretes["EditorEng"].rule("_3", cs)), new Suffix("floats", Editor.concretes["EditorEng"].rule("_76", cs))), new Int(0));}, French: function(cs){return new Arr(new Arr(Editor.concretes["EditorEng"].rule("_80", cs), Editor.concretes["EditorEng"].rule("_80", cs)), new Int(0));}, German: function(cs){return new Arr(new Arr(Editor.concretes["EditorEng"].rule("_83", cs), Editor.concretes["EditorEng"].rule("_83", cs)), new Int(0));}, IndefPlDet: function(cs){return Editor.concretes["EditorEng"].rule("_89", cs);}, IndefSgDet: function(cs){return Editor.concretes["EditorEng"].rule("_89", cs);}, Integer_N: function(cs){return new Arr(new Arr(new Suffix("integer", Editor.concretes["EditorEng"].rule("_3", cs)), new Suffix("integers", Editor.concretes["EditorEng"].rule("_76", cs))), new Int(0));}, Italian: function(cs){return new Arr(new Arr(Editor.concretes["EditorEng"].rule("_94", cs), Editor.concretes["EditorEng"].rule("_94", cs)), new Int(0));}, Label: function(cs){return new Arr(Editor.concretes["EditorEng"].rule("_8", cs).sel(new Int(0)));}, Language: function(cs){return new Arr(new Arr(new Suffix("language", Editor.concretes["EditorEng"].rule("_3", cs)), new Suffix("languages", Editor.concretes["EditorEng"].rule("_76", cs))), new Int(0));}, Next: function(cs){return new Arr(new Suffix("next", Editor.concretes["EditorEng"].rule("_103", cs)));}, Node: function(cs){return new Arr(new Arr(new Suffix("node", Editor.concretes["EditorEng"].rule("_3", cs)), new Suffix("nodes", Editor.concretes["EditorEng"].rule("_76", cs))), new Int(0));}, Norwegian: function(cs){return new Arr(new Arr(Editor.concretes["EditorEng"].rule("_110", cs), Editor.concretes["EditorEng"].rule("_110", cs)), new Int(0));}, Page: function(cs){return new Arr(new Arr(new Suffix("page", Editor.concretes["EditorEng"].rule("_3", cs)), new Suffix("pages", Editor.concretes["EditorEng"].rule("_76", cs))), new Int(0));}, Parse: function(cs){return new Arr(new Suffix("Pars", Editor.concretes["EditorEng"].rule("_44", cs)), new Int(1));}, Paste: function(cs){return new Arr(new Suffix("Past", Editor.concretes["EditorEng"].rule("_44", cs)), new Int(1));}, Previous: function(cs){return new Arr(new Suffix("previous", Editor.concretes["EditorEng"].rule("_103", cs)));}, RandomlyCommand: function(cs){return new Arr(new Seq(Editor.concretes["EditorEng"].rule("_8", cs), Editor.concretes["EditorEng"].rule("_11", cs), Editor.concretes["EditorEng"].rule("_14", cs), Editor.concretes["EditorEng"].rule("_18", cs), new Str("at"), new Str("random")));}, Redo: function(cs){return new Arr(new Suffix("Redo", Editor.concretes["EditorEng"].rule("_125", cs)), new Int(1));}, Refine: function(cs){return new Arr(new Suffix("Refin", Editor.concretes["EditorEng"].rule("_44", cs)), new Int(1));}, Refinement: function(cs){return new Arr(new Arr(new Suffix("refinement", Editor.concretes["EditorEng"].rule("_3", cs)), new Suffix("refinements", Editor.concretes["EditorEng"].rule("_76", cs))), new Int(0));}, Replace: function(cs){return new Arr(new Suffix("Replac", Editor.concretes["EditorEng"].rule("_44", cs)), new Int(1));}, Russian: function(cs){return new Arr(new Arr(Editor.concretes["EditorEng"].rule("_136", cs), Editor.concretes["EditorEng"].rule("_136", cs)), new Int(0));}, Select: function(cs){return new Arr(new Suffix("Select", Editor.concretes["EditorEng"].rule("_34", cs)), new Int(1));}, Show: function(cs){return new Arr(new Suffix("Show", Editor.concretes["EditorEng"].rule("_34", cs)), new Int(1));}, SingleWordCommand: function(cs){return new Arr(new Seq(Editor.concretes["EditorEng"].rule("_8", cs), Editor.concretes["EditorEng"].rule("_18", cs)));}, Spanish: function(cs){return new Arr(new Arr(Editor.concretes["EditorEng"].rule("_145", cs), Editor.concretes["EditorEng"].rule("_145", cs)), new Int(0));}, String_N: function(cs){return new Arr(new Arr(new Suffix("string", Editor.concretes["EditorEng"].rule("_3", cs)), new Suffix("strings", Editor.concretes["EditorEng"].rule("_76", cs))), new Int(0));}, Swedish: function(cs){return new Arr(new Arr(Editor.concretes["EditorEng"].rule("_152", cs), Editor.concretes["EditorEng"].rule("_152", cs)), new Int(0));}, Tree: function(cs){return new Arr(new Arr(new Suffix("tree", Editor.concretes["EditorEng"].rule("_3", cs)), new Suffix("trees", Editor.concretes["EditorEng"].rule("_76", cs))), new Int(0));}, Undo: function(cs){return new Arr(new Suffix("Undo", Editor.concretes["EditorEng"].rule("_125", cs)), new Int(1));}, Wrap: function(cs){return new Arr(new Suffix("Wrap", Editor.concretes["EditorEng"].rule("_34", cs)), new Int(1));}, Wrapper: function(cs){return new Arr(new Arr(new Suffix("wrapper", Editor.concretes["EditorEng"].rule("_3", cs)), new Suffix("wrappers", Editor.concretes["EditorEng"].rule("_76", cs))), new Int(0));}, _10: function(cs){return Editor.concretes["EditorEng"].rule("_9", cs).sel(new Int(1));}, _103: function(cs){return new Arr(new Str(""), new Str("er"), new Str("est"), new Str("ly"));}, _11: function(cs){return Editor.concretes["EditorEng"].rule("_10", cs).sel(new Int(0));}, _110: function(cs){return new Suffix("Norwegian", Editor.concretes["EditorEng"].rule("_3", cs));}, _12: function(cs){return cs[2].sel(new Int(0));}, _125: function(cs){return new Arr(new Str(""), new Str("es"), new Str("ed"), new Str("ing"));}, _13: function(cs){return Editor.concretes["EditorEng"].rule("_12", cs).sel(new Int(0));}, _136: function(cs){return new Suffix("Russian", Editor.concretes["EditorEng"].rule("_3", cs));}, _14: function(cs){return Editor.concretes["EditorEng"].rule("_13", cs).sel(new Int(1));}, _145: function(cs){return new Suffix("Spanish", Editor.concretes["EditorEng"].rule("_3", cs));}, _15: function(cs){return new Seq();}, _152: function(cs){return new Suffix("Swedish", Editor.concretes["EditorEng"].rule("_3", cs));}, _16: function(cs){return new Arr(new Str("yourself"), Editor.concretes["EditorEng"].rule("_15", cs));}, _167: function(cs){return new Arr(cs[0], cs[0], cs[0], cs[0]);}, _169: function(cs){return new Arr(cs[0], cs[0]);}, _17: function(cs){return cs[0].sel(new Int(1));}, _172: function(cs){return new Arr(cs[0], cs[0], cs[0]);}, _18: function(cs){return Editor.concretes["EditorEng"].rule("_16", cs).sel(Editor.concretes["EditorEng"].rule("_17", cs));}, _22: function(cs){return new Arr(new Int(4), new Int(5), new Int(6));}, _3: function(cs){return new Arr(new Str(""), new Str(""), new Str("'s"));}, _34: function(cs){return new Arr(new Str(""), new Str("s"), new Str("ed"), new Str("ing"));}, _37: function(cs){return new Suffix("Danish", Editor.concretes["EditorEng"].rule("_3", cs));}, _4: function(cs){return new Suffix("Bulgarian", Editor.concretes["EditorEng"].rule("_3", cs));}, _40: function(cs){return new Arr(new Str(""), new Str(""));}, _41: function(cs){return new Suffix("the", Editor.concretes["EditorEng"].rule("_40", cs));}, _42: function(cs){return new Arr(Editor.concretes["EditorEng"].rule("_41", cs), Editor.concretes["EditorEng"].rule("_41", cs));}, _43: function(cs){return new Arr(Editor.concretes["EditorEng"].rule("_42", cs));}, _44: function(cs){return new Arr(new Str("e"), new Str("es"), new Str("ed"), new Str("ing"));}, _47: function(cs){return new Suffix("English", Editor.concretes["EditorEng"].rule("_3", cs));}, _54: function(cs){return new Arr(new Int(4), new Int(7));}, _55: function(cs){return new Arr(new Int(0), new Int(1), new Int(0), new Int(1), new Int(0), new Int(0), new Int(0), new Int(1));}, _56: function(cs){return cs[1].sel(new Int(1));}, _57: function(cs){return Editor.concretes["EditorEng"].rule("_22", cs).sel(Editor.concretes["EditorEng"].rule("_56", cs));}, _58: function(cs){return Editor.concretes["EditorEng"].rule("_55", cs).sel(Editor.concretes["EditorEng"].rule("_57", cs));}, _59: function(cs){return Editor.concretes["EditorEng"].rule("_54", cs).sel(Editor.concretes["EditorEng"].rule("_58", cs));}, _61: function(cs){return new Arr(Editor.concretes["EditorEng"].rule("_15", cs), Editor.concretes["EditorEng"].rule("_15", cs), Editor.concretes["EditorEng"].rule("_15", cs), Editor.concretes["EditorEng"].rule("_15", cs), Editor.concretes["EditorEng"].rule("_15", cs), Editor.concretes["EditorEng"].rule("_15", cs), Editor.concretes["EditorEng"].rule("_15", cs), Editor.concretes["EditorEng"].rule("_15", cs));}, _62: function(cs){return Editor.concretes["EditorEng"].rule("_61", cs).sel(Editor.concretes["EditorEng"].rule("_59", cs));}, _63: function(cs){return new Arr(Editor.concretes["EditorEng"].rule("_8", cs), Editor.concretes["EditorEng"].rule("_8", cs), Editor.concretes["EditorEng"].rule("_8", cs), Editor.concretes["EditorEng"].rule("_8", cs), Editor.concretes["EditorEng"].rule("_8", cs), Editor.concretes["EditorEng"].rule("_8", cs), Editor.concretes["EditorEng"].rule("_8", cs), Editor.concretes["EditorEng"].rule("_8", cs));}, _64: function(cs){return Editor.concretes["EditorEng"].rule("_63", cs).sel(Editor.concretes["EditorEng"].rule("_57", cs));}, _65: function(cs){return Editor.concretes["EditorEng"].rule("_9", cs).sel(new Int(0));}, _66: function(cs){return Editor.concretes["EditorEng"].rule("_65", cs).sel(new Int(1));}, _67: function(cs){return new Seq(new Str("a"), Editor.concretes["EditorEng"].rule("_64", cs), Editor.concretes["EditorEng"].rule("_66", cs));}, _7: function(cs){return cs[0].sel(new Int(0));}, _72: function(cs){return new Suffix("Finnish", Editor.concretes["EditorEng"].rule("_3", cs));}, _76: function(cs){return new Arr(new Str(""), new Str(""), new Str("'"));}, _8: function(cs){return Editor.concretes["EditorEng"].rule("_7", cs).sel(new Int(0));}, _80: function(cs){return new Suffix("French", Editor.concretes["EditorEng"].rule("_3", cs));}, _83: function(cs){return new Suffix("German", Editor.concretes["EditorEng"].rule("_3", cs));}, _86: function(cs){return new Arr(Editor.concretes["EditorEng"].rule("_15", cs), Editor.concretes["EditorEng"].rule("_15", cs));}, _87: function(cs){return new Arr(new Str("a"), Editor.concretes["EditorEng"].rule("_15", cs));}, _88: function(cs){return new Arr(Editor.concretes["EditorEng"].rule("_86", cs), Editor.concretes["EditorEng"].rule("_87", cs));}, _89: function(cs){return new Arr(Editor.concretes["EditorEng"].rule("_88", cs));}, _9: function(cs){return cs[1].sel(new Int(0));}, _94: function(cs){return new Suffix("Italian", Editor.concretes["EditorEng"].rule("_3", cs));}, Adjective: function(cs){return new Arr(Editor.concretes["EditorEng"].rule("_167", cs));}, Determiner: function(cs){return new Arr(new Arr(Editor.concretes["EditorEng"].rule("_169", cs), Editor.concretes["EditorEng"].rule("_169", cs)));}, Noun: function(cs){return new Arr(new Arr(Editor.concretes["EditorEng"].rule("_172", cs), Editor.concretes["EditorEng"].rule("_172", cs)), new Int(0));}, Sentence: function(cs){return new Arr(cs[0]);}, Verb: function(cs){return new Arr(Editor.concretes["EditorEng"].rule("_167", cs), new Int(0));}, "Int": function(cs){return new Arr(cs[0]);}, "Float": function(cs){return new Arr(cs[0]);}, "String": function(cs){return new Arr(cs[0]);}}, new Parser("Sentence",[new Rule(10, new FunApp("Wrapper",[]),[],[[new Terminal("wrapper")]]), new Rule(9, new FunApp("Wrapper",[]),[],[[new Terminal("wrapper")]]), new Rule(8, new FunApp("Wrapper",[]),[],[[new Terminal("wrapper's")]]), new Rule(7, new FunApp("Wrapper",[]),[],[[new Terminal("wrappers")]]), new Rule(6, new FunApp("Wrapper",[]),[],[[new Terminal("wrappers")]]), new Rule(5, new FunApp("Wrapper",[]),[],[[new Terminal("wrappers'")]]), new Rule(17, new FunApp("Wrap",[]),[],[[new Terminal("Wrap")]]), new Rule(20, new FunApp("Wrap",[]),[],[[new Terminal("Wraps")]]), new Rule(19, new FunApp("Wrap",[]),[],[[new Terminal("Wraped")]]), new Rule(18, new FunApp("Wrap",[]),[],[[new Terminal("Wraping")]]), new Rule(17, new FunApp("Undo",[]),[],[[new Terminal("Undo")]]), new Rule(20, new FunApp("Undo",[]),[],[[new Terminal("Undoes")]]), new Rule(19, new FunApp("Undo",[]),[],[[new Terminal("Undoed")]]), new Rule(18, new FunApp("Undo",[]),[],[[new Terminal("Undoing")]]), new Rule(10, new FunApp("Tree",[]),[],[[new Terminal("tree")]]), new Rule(9, new FunApp("Tree",[]),[],[[new Terminal("tree")]]), new Rule(8, new FunApp("Tree",[]),[],[[new Terminal("tree's")]]), new Rule(7, new FunApp("Tree",[]),[],[[new Terminal("trees")]]), new Rule(6, new FunApp("Tree",[]),[],[[new Terminal("trees")]]), new Rule(5, new FunApp("Tree",[]),[],[[new Terminal("trees'")]]), new Rule(10, new FunApp("Swedish",[]),[],[[new Terminal("Swedish")]]), new Rule(9, new FunApp("Swedish",[]),[],[[new Terminal("Swedish")]]), new Rule(8, new FunApp("Swedish",[]),[],[[new Terminal("Swedish's")]]), new Rule(7, new FunApp("Swedish",[]),[],[[new Terminal("Swedish")]]), new Rule(6, new FunApp("Swedish",[]),[],[[new Terminal("Swedish")]]), new Rule(5, new FunApp("Swedish",[]),[],[[new Terminal("Swedish's")]]), new Rule(10, new FunApp("String_N",[]),[],[[new Terminal("string")]]), new Rule(9, new FunApp("String_N",[]),[],[[new Terminal("string")]]), new Rule(8, new FunApp("String_N",[]),[],[[new Terminal("string's")]]), new Rule(7, new FunApp("String_N",[]),[],[[new Terminal("strings")]]), new Rule(6, new FunApp("String_N",[]),[],[[new Terminal("strings")]]), new Rule(5, new FunApp("String_N",[]),[],[[new Terminal("strings'")]]), new Rule(10, new FunApp("Spanish",[]),[],[[new Terminal("Spanish")]]), new Rule(9, new FunApp("Spanish",[]),[],[[new Terminal("Spanish")]]), new Rule(8, new FunApp("Spanish",[]),[],[[new Terminal("Spanish's")]]), new Rule(7, new FunApp("Spanish",[]),[],[[new Terminal("Spanish")]]), new Rule(6, new FunApp("Spanish",[]),[],[[new Terminal("Spanish")]]), new Rule(5, new FunApp("Spanish",[]),[],[[new Terminal("Spanish's")]]), new Rule(11, new FunApp("SingleWordCommand",[new Arg(0)]),[17],[[new ArgProj(0, 0)]]), new Rule(11, new FunApp("SingleWordCommand",[new Arg(0)]),[16],[[new ArgProj(0, 0), new Terminal("yourself")]]), new Rule(17, new FunApp("Show",[]),[],[[new Terminal("Show")]]), new Rule(20, new FunApp("Show",[]),[],[[new Terminal("Shows")]]), new Rule(19, new FunApp("Show",[]),[],[[new Terminal("Showed")]]), new Rule(18, new FunApp("Show",[]),[],[[new Terminal("Showing")]]), new Rule(17, new FunApp("Select",[]),[],[[new Terminal("Select")]]), new Rule(20, new FunApp("Select",[]),[],[[new Terminal("Selects")]]), new Rule(19, new FunApp("Select",[]),[],[[new Terminal("Selected")]]), new Rule(18, new FunApp("Select",[]),[],[[new Terminal("Selecting")]]), new Rule(10, new FunApp("Russian",[]),[],[[new Terminal("Russian")]]), new Rule(9, new FunApp("Russian",[]),[],[[new Terminal("Russian")]]), new Rule(8, new FunApp("Russian",[]),[],[[new Terminal("Russian's")]]), new Rule(7, new FunApp("Russian",[]),[],[[new Terminal("Russian")]]), new Rule(6, new FunApp("Russian",[]),[],[[new Terminal("Russian")]]), new Rule(5, new FunApp("Russian",[]),[],[[new Terminal("Russian's")]]), new Rule(17, new FunApp("Replace",[]),[],[[new Terminal("Replace")]]), new Rule(20, new FunApp("Replace",[]),[],[[new Terminal("Replaces")]]), new Rule(19, new FunApp("Replace",[]),[],[[new Terminal("Replaced")]]), new Rule(18, new FunApp("Replace",[]),[],[[new Terminal("Replacing")]]), new Rule(10, new FunApp("Refinement",[]),[],[[new Terminal("refinement")]]), new Rule(9, new FunApp("Refinement",[]),[],[[new Terminal("refinement")]]), new Rule(8, new FunApp("Refinement",[]),[],[[new Terminal("refinement's")]]), new Rule(7, new FunApp("Refinement",[]),[],[[new Terminal("refinements")]]), new Rule(6, new FunApp("Refinement",[]),[],[[new Terminal("refinements")]]), new Rule(5, new FunApp("Refinement",[]),[],[[new Terminal("refinements'")]]), new Rule(17, new FunApp("Refine",[]),[],[[new Terminal("Refine")]]), new Rule(20, new FunApp("Refine",[]),[],[[new Terminal("Refines")]]), new Rule(19, new FunApp("Refine",[]),[],[[new Terminal("Refined")]]), new Rule(18, new FunApp("Refine",[]),[],[[new Terminal("Refining")]]), new Rule(17, new FunApp("Redo",[]),[],[[new Terminal("Redo")]]), new Rule(20, new FunApp("Redo",[]),[],[[new Terminal("Redoes")]]), new Rule(19, new FunApp("Redo",[]),[],[[new Terminal("Redoed")]]), new Rule(18, new FunApp("Redo",[]),[],[[new Terminal("Redoing")]]), new Rule(11, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[17, 15, 12],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("at"), new Terminal("random")]]), new Rule(11, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[16, 15, 12],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("yourself"), new Terminal("at"), new Terminal("random")]]), new Rule(4, new FunApp("Previous",[]),[],[[new Terminal("previous")]]), new Rule(3, new FunApp("Previous",[]),[],[[new Terminal("previouser")]]), new Rule(2, new FunApp("Previous",[]),[],[[new Terminal("previousest")]]), new Rule(1, new FunApp("Previous",[]),[],[[new Terminal("previously")]]), new Rule(17, new FunApp("Paste",[]),[],[[new Terminal("Paste")]]), new Rule(20, new FunApp("Paste",[]),[],[[new Terminal("Pastes")]]), new Rule(19, new FunApp("Paste",[]),[],[[new Terminal("Pasted")]]), new Rule(18, new FunApp("Paste",[]),[],[[new Terminal("Pasting")]]), new Rule(17, new FunApp("Parse",[]),[],[[new Terminal("Parse")]]), new Rule(20, new FunApp("Parse",[]),[],[[new Terminal("Parses")]]), new Rule(19, new FunApp("Parse",[]),[],[[new Terminal("Parsed")]]), new Rule(18, new FunApp("Parse",[]),[],[[new Terminal("Parsing")]]), new Rule(10, new FunApp("Page",[]),[],[[new Terminal("page")]]), new Rule(9, new FunApp("Page",[]),[],[[new Terminal("page")]]), new Rule(8, new FunApp("Page",[]),[],[[new Terminal("page's")]]), new Rule(7, new FunApp("Page",[]),[],[[new Terminal("pages")]]), new Rule(6, new FunApp("Page",[]),[],[[new Terminal("pages")]]), new Rule(5, new FunApp("Page",[]),[],[[new Terminal("pages'")]]), new Rule(10, new FunApp("Norwegian",[]),[],[[new Terminal("Norwegian")]]), new Rule(9, new FunApp("Norwegian",[]),[],[[new Terminal("Norwegian")]]), new Rule(8, new FunApp("Norwegian",[]),[],[[new Terminal("Norwegian's")]]), new Rule(7, new FunApp("Norwegian",[]),[],[[new Terminal("Norwegian")]]), new Rule(6, new FunApp("Norwegian",[]),[],[[new Terminal("Norwegian")]]), new Rule(5, new FunApp("Norwegian",[]),[],[[new Terminal("Norwegian's")]]), new Rule(10, new FunApp("Node",[]),[],[[new Terminal("node")]]), new Rule(9, new FunApp("Node",[]),[],[[new Terminal("node")]]), new Rule(8, new FunApp("Node",[]),[],[[new Terminal("node's")]]), new Rule(7, new FunApp("Node",[]),[],[[new Terminal("nodes")]]), new Rule(6, new FunApp("Node",[]),[],[[new Terminal("nodes")]]), new Rule(5, new FunApp("Node",[]),[],[[new Terminal("nodes'")]]), new Rule(4, new FunApp("Next",[]),[],[[new Terminal("next")]]), new Rule(3, new FunApp("Next",[]),[],[[new Terminal("nexter")]]), new Rule(2, new FunApp("Next",[]),[],[[new Terminal("nextest")]]), new Rule(1, new FunApp("Next",[]),[],[[new Terminal("nextly")]]), new Rule(10, new FunApp("Language",[]),[],[[new Terminal("language")]]), new Rule(9, new FunApp("Language",[]),[],[[new Terminal("language")]]), new Rule(8, new FunApp("Language",[]),[],[[new Terminal("language's")]]), new Rule(7, new FunApp("Language",[]),[],[[new Terminal("languages")]]), new Rule(6, new FunApp("Language",[]),[],[[new Terminal("languages")]]), new Rule(5, new FunApp("Language",[]),[],[[new Terminal("languages'")]]), new Rule(11, new FunApp("Label",[new Arg(0)]),[24],[[new ArgProj(0, 0)]]), new Rule(24, new Arg(0),[26],[[new ArgProj(0, 0)]]), new Rule(24, new Arg(0),[25],[[new ArgProj(0, 0)]]), new Rule(24, new Arg(0),[10],[[new ArgProj(0, 0)]]), new Rule(10, new FunApp("Italian",[]),[],[[new Terminal("Italian")]]), new Rule(9, new FunApp("Italian",[]),[],[[new Terminal("Italian")]]), new Rule(8, new FunApp("Italian",[]),[],[[new Terminal("Italian's")]]), new Rule(7, new FunApp("Italian",[]),[],[[new Terminal("Italian")]]), new Rule(6, new FunApp("Italian",[]),[],[[new Terminal("Italian")]]), new Rule(5, new FunApp("Italian",[]),[],[[new Terminal("Italian's")]]), new Rule(10, new FunApp("Integer_N",[]),[],[[new Terminal("integer")]]), new Rule(9, new FunApp("Integer_N",[]),[],[[new Terminal("integer")]]), new Rule(8, new FunApp("Integer_N",[]),[],[[new Terminal("integer's")]]), new Rule(7, new FunApp("Integer_N",[]),[],[[new Terminal("integers")]]), new Rule(6, new FunApp("Integer_N",[]),[],[[new Terminal("integers")]]), new Rule(5, new FunApp("Integer_N",[]),[],[[new Terminal("integers'")]]), new Rule(23, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(22, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(15, new FunApp("IndefSgDet",[]),[],[[new Terminal("an")]]), new Rule(15, new FunApp("IndefSgDet",[]),[],[[new Terminal("a")]]), new Rule(21, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(23, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(22, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(15, new FunApp("IndefPlDet",[]),[],[[new Terminal("an")]]), new Rule(15, new FunApp("IndefPlDet",[]),[],[[new Terminal("a")]]), new Rule(21, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(10, new FunApp("German",[]),[],[[new Terminal("German")]]), new Rule(9, new FunApp("German",[]),[],[[new Terminal("German")]]), new Rule(8, new FunApp("German",[]),[],[[new Terminal("German's")]]), new Rule(7, new FunApp("German",[]),[],[[new Terminal("German")]]), new Rule(6, new FunApp("German",[]),[],[[new Terminal("German")]]), new Rule(5, new FunApp("German",[]),[],[[new Terminal("German's")]]), new Rule(10, new FunApp("French",[]),[],[[new Terminal("French")]]), new Rule(9, new FunApp("French",[]),[],[[new Terminal("French")]]), new Rule(8, new FunApp("French",[]),[],[[new Terminal("French's")]]), new Rule(7, new FunApp("French",[]),[],[[new Terminal("French")]]), new Rule(6, new FunApp("French",[]),[],[[new Terminal("French")]]), new Rule(5, new FunApp("French",[]),[],[[new Terminal("French's")]]), new Rule(10, new FunApp("Float_N",[]),[],[[new Terminal("float")]]), new Rule(9, new FunApp("Float_N",[]),[],[[new Terminal("float")]]), new Rule(8, new FunApp("Float_N",[]),[],[[new Terminal("float's")]]), new Rule(7, new FunApp("Float_N",[]),[],[[new Terminal("floats")]]), new Rule(6, new FunApp("Float_N",[]),[],[[new Terminal("floats")]]), new Rule(5, new FunApp("Float_N",[]),[],[[new Terminal("floats'")]]), new Rule(10, new FunApp("Finnish",[]),[],[[new Terminal("Finnish")]]), new Rule(9, new FunApp("Finnish",[]),[],[[new Terminal("Finnish")]]), new Rule(8, new FunApp("Finnish",[]),[],[[new Terminal("Finnish's")]]), new Rule(7, new FunApp("Finnish",[]),[],[[new Terminal("Finnish")]]), new Rule(6, new FunApp("Finnish",[]),[],[[new Terminal("Finnish")]]), new Rule(5, new FunApp("Finnish",[]),[],[[new Terminal("Finnish's")]]), new Rule(11, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[4, 14],[[new Terminal("there"), new Terminal("isn't"), new Terminal("an"), new ArgProj(0, 0), new ArgProj(1, 0)]]), new Rule(11, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[4, 14],[[new Terminal("there"), new Terminal("isn't"), new Terminal("a"), new ArgProj(0, 0), new ArgProj(1, 0)]]), new Rule(11, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[4, 13],[[new Terminal("there"), new Terminal("isn't"), new Terminal("an"), new ArgProj(0, 0), new ArgProj(1, 0)]]), new Rule(11, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[4, 13],[[new Terminal("there"), new Terminal("isn't"), new Terminal("a"), new ArgProj(0, 0), new ArgProj(1, 0)]]), new Rule(11, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[4, 9],[[new Terminal("there"), new Terminal("isn't"), new Terminal("an"), new ArgProj(0, 0), new ArgProj(1, 0)]]), new Rule(11, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[4, 9],[[new Terminal("there"), new Terminal("isn't"), new Terminal("a"), new ArgProj(0, 0), new ArgProj(1, 0)]]), new Rule(17, new FunApp("Enter",[]),[],[[new Terminal("Enter")]]), new Rule(20, new FunApp("Enter",[]),[],[[new Terminal("Enters")]]), new Rule(19, new FunApp("Enter",[]),[],[[new Terminal("Entered")]]), new Rule(18, new FunApp("Enter",[]),[],[[new Terminal("Entering")]]), new Rule(10, new FunApp("English",[]),[],[[new Terminal("English")]]), new Rule(9, new FunApp("English",[]),[],[[new Terminal("English")]]), new Rule(8, new FunApp("English",[]),[],[[new Terminal("English's")]]), new Rule(7, new FunApp("English",[]),[],[[new Terminal("English")]]), new Rule(6, new FunApp("English",[]),[],[[new Terminal("English")]]), new Rule(5, new FunApp("English",[]),[],[[new Terminal("English's")]]), new Rule(17, new FunApp("Delete",[]),[],[[new Terminal("Delete")]]), new Rule(20, new FunApp("Delete",[]),[],[[new Terminal("Deletes")]]), new Rule(19, new FunApp("Delete",[]),[],[[new Terminal("Deleted")]]), new Rule(18, new FunApp("Delete",[]),[],[[new Terminal("Deleting")]]), new Rule(23, new FunApp("DefSgDet",[]),[],[[new Terminal("the")]]), new Rule(22, new FunApp("DefSgDet",[]),[],[[new Terminal("the")]]), new Rule(15, new FunApp("DefSgDet",[]),[],[[new Terminal("the")]]), new Rule(21, new FunApp("DefSgDet",[]),[],[[new Terminal("the")]]), new Rule(23, new FunApp("DefPlDet",[]),[],[[new Terminal("the")]]), new Rule(22, new FunApp("DefPlDet",[]),[],[[new Terminal("the")]]), new Rule(15, new FunApp("DefPlDet",[]),[],[[new Terminal("the")]]), new Rule(21, new FunApp("DefPlDet",[]),[],[[new Terminal("the")]]), new Rule(10, new FunApp("Danish",[]),[],[[new Terminal("Danish")]]), new Rule(9, new FunApp("Danish",[]),[],[[new Terminal("Danish")]]), new Rule(8, new FunApp("Danish",[]),[],[[new Terminal("Danish's")]]), new Rule(7, new FunApp("Danish",[]),[],[[new Terminal("Danish")]]), new Rule(6, new FunApp("Danish",[]),[],[[new Terminal("Danish")]]), new Rule(5, new FunApp("Danish",[]),[],[[new Terminal("Danish's")]]), new Rule(17, new FunApp("Cut",[]),[],[[new Terminal("Cut")]]), new Rule(20, new FunApp("Cut",[]),[],[[new Terminal("Cuts")]]), new Rule(19, new FunApp("Cut",[]),[],[[new Terminal("Cuted")]]), new Rule(18, new FunApp("Cut",[]),[],[[new Terminal("Cuting")]]), new Rule(17, new FunApp("Copy",[]),[],[[new Terminal("Copy")]]), new Rule(20, new FunApp("Copy",[]),[],[[new Terminal("Copies")]]), new Rule(19, new FunApp("Copy",[]),[],[[new Terminal("Copied")]]), new Rule(18, new FunApp("Copy",[]),[],[[new Terminal("Copying")]]), new Rule(11, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[17, 15, 4, 14],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(11, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[17, 15, 4, 13],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(11, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[17, 15, 4, 9],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(11, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[16, 15, 4, 14],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0), new Terminal("yourself")]]), new Rule(11, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[16, 15, 4, 13],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0), new Terminal("yourself")]]), new Rule(11, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[16, 15, 4, 9],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0), new Terminal("yourself")]]), new Rule(11, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[17, 15, 12],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(11, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[16, 15, 12],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("yourself")]]), new Rule(12, new Arg(0),[14],[[new ArgProj(0, 0)]]), new Rule(12, new Arg(0),[13],[[new ArgProj(0, 0)]]), new Rule(12, new Arg(0),[9],[[new ArgProj(0, 0)]]), new Rule(10, new FunApp("Bulgarian",[]),[],[[new Terminal("Bulgarian")]]), new Rule(9, new FunApp("Bulgarian",[]),[],[[new Terminal("Bulgarian")]]), new Rule(8, new FunApp("Bulgarian",[]),[],[[new Terminal("Bulgarian's")]]), new Rule(7, new FunApp("Bulgarian",[]),[],[[new Terminal("Bulgarian")]]), new Rule(6, new FunApp("Bulgarian",[]),[],[[new Terminal("Bulgarian")]]), new Rule(5, new FunApp("Bulgarian",[]),[],[[new Terminal("Bulgarian's")]]), new Rule(4, new FunApp("Available",[]),[],[[new Terminal("available")]]), new Rule(3, new FunApp("Available",[]),[],[[new Terminal("availabler")]]), new Rule(2, new FunApp("Available",[]),[],[[new Terminal("availablest")]]), new Rule(1, new FunApp("Available",[]),[],[[new Terminal("availablely")]])],{Adjective:[4, 3, 2, 1], Determiner:[23, 15, 22, 21], Float:[-3], Int:[-2], Noun:[24, 10, 25, 26, 7, 12, 9, 13, 14, 6, 8, 5], Sentence:[11], String:[-1], Verb:[16, 17, 20, 19, 18], _Var:[-4]})), EditorFre: new GFConcrete({coding: "utf8"},{Available: function(cs){return new Arr(new Arr(new Suffix("disponible", new Arr(new Str(""), new Str("s"), new Str(""), new Str("s"), new Str("ment"))), Editor.concretes["EditorFre"].rule("_5", cs), Editor.concretes["EditorFre"].rule("_5", cs)), new Int(1));}, Bulgarian: function(cs){return new Arr(new Suffix("bulgarien", Editor.concretes["EditorFre"].rule("_8", cs)), new Int(0));}, Command: function(cs){return new Arr(new Seq(Editor.concretes["EditorFre"].rule("_41", cs), Editor.concretes["EditorFre"].rule("_43", cs), Editor.concretes["EditorFre"].rule("_45", cs), Editor.concretes["EditorFre"].rule("_58", cs)));}, CommandAdj: function(cs){return new Arr(new Seq((new Arr(Editor.concretes["EditorFre"].rule("_68", cs), Editor.concretes["EditorFre"].rule("_69", cs), Editor.concretes["EditorFre"].rule("_70", cs), Editor.concretes["EditorFre"].rule("_71", cs), Editor.concretes["EditorFre"].rule("_72", cs), Editor.concretes["EditorFre"].rule("_73", cs), Editor.concretes["EditorFre"].rule("_68", cs), Editor.concretes["EditorFre"].rule("_69", cs), Editor.concretes["EditorFre"].rule("_70", cs), Editor.concretes["EditorFre"].rule("_71", cs), Editor.concretes["EditorFre"].rule("_72", cs), Editor.concretes["EditorFre"].rule("_73", cs), Editor.concretes["EditorFre"].rule("_67", cs), Editor.concretes["EditorFre"].rule("_67", cs))).sel(Editor.concretes["EditorFre"].rule("_40", cs)), Editor.concretes["EditorFre"].rule("_43", cs), Editor.concretes["EditorFre"].rule("_45", cs),(new Arr(new Arr(Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_87", cs)), new Arr(Editor.concretes["EditorFre"].rule("_87", cs), Editor.concretes["EditorFre"].rule("_87", cs)))).sel(Editor.concretes["EditorFre"].rule("_25", cs)).sel(Editor.concretes["EditorFre"].rule("_27", cs))));}, Copy: function(cs){return new Arr(new Suffix("copi", Editor.concretes["EditorFre"].rule("_95", cs)), new Int(0));}, Cut: function(cs){return new Arr(new Suffix("coup", Editor.concretes["EditorFre"].rule("_95", cs)), new Int(0));}, Danish: function(cs){return new Arr(new Suffix("danois", Editor.concretes["EditorFre"].rule("_100", cs)), new Int(0));}, DefPlDet: function(cs){return Editor.concretes["EditorFre"].rule("_112", cs);}, DefSgDet: function(cs){return Editor.concretes["EditorFre"].rule("_112", cs);}, Delete: function(cs){return new Arr(new Suffix("enlev", Editor.concretes["EditorFre"].rule("_95", cs)), new Int(0));}, English: function(cs){return new Arr(new Suffix("anglais", Editor.concretes["EditorFre"].rule("_100", cs)), new Int(0));}, Enter: function(cs){return new Arr(new Suffix("introdui", new Arr(new Str("re"), new Str("re"), new Str("s"), new Str("s"), new Str("t"), new Str("sons"), new Str("sez"), new Str("sent"), new Str("se"), new Str("ses"), new Str("se"), new Str("sions"), new Str("siez"), new Str("sent"), new Str("s"), new Str("sons"), new Str("sez"), new Str("t"), new Str("ts"), new Str("te"), new Str("tes"), new Str("sant"))), new Int(0));}, ErrorMessage: function(cs){return new Arr(new Seq(new Str("il"), new Str("ne"), new Str("y"), new Str("a"), new Str("pas"),(new Arr(new Str("des"), new Str("des"))).sel(Editor.concretes["EditorFre"].rule("_121", cs)),(new Arr(new Seq(Editor.concretes["EditorFre"].rule("_125", cs), Editor.concretes["EditorFre"].rule("_47", cs)), new Seq(Editor.concretes["EditorFre"].rule("_47", cs), Editor.concretes["EditorFre"].rule("_125", cs)))).sel(Editor.concretes["EditorFre"].rule("_18", cs))));}, Finnish: function(cs){return new Arr(new Suffix("finnois", Editor.concretes["EditorFre"].rule("_100", cs)), new Int(0));}, Float_N: function(cs){return new Arr(new Suffix("réel", Editor.concretes["EditorFre"].rule("_8", cs)), new Int(0));}, French: function(cs){return new Arr(new Suffix("français", Editor.concretes["EditorFre"].rule("_100", cs)), new Int(0));}, German: function(cs){return new Arr(new Suffix("allemand", Editor.concretes["EditorFre"].rule("_8", cs)), new Int(0));}, IndefPlDet: function(cs){return Editor.concretes["EditorFre"].rule("_155", cs);}, IndefSgDet: function(cs){return Editor.concretes["EditorFre"].rule("_155", cs);}, Integer_N: function(cs){return new Arr(new Suffix("entier", Editor.concretes["EditorFre"].rule("_8", cs)), new Int(0));}, Italian: function(cs){return new Arr(new Suffix("italien", Editor.concretes["EditorFre"].rule("_8", cs)), new Int(0));}, Label: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_43", cs));}, Language: function(cs){return new Arr(new Suffix("langue", Editor.concretes["EditorFre"].rule("_8", cs)), new Int(1));}, Next: function(cs){return new Arr(new Arr(new Suffix("prochain", Editor.concretes["EditorFre"].rule("_163", cs)), Editor.concretes["EditorFre"].rule("_170", cs), Editor.concretes["EditorFre"].rule("_170", cs)), new Int(1));}, Node: function(cs){return new Arr(new Suffix("noeud", Editor.concretes["EditorFre"].rule("_8", cs)), new Int(0));}, Norwegian: function(cs){return new Arr(new Suffix("norvégien", Editor.concretes["EditorFre"].rule("_8", cs)), new Int(0));}, Page: function(cs){return new Arr(new Suffix("page", Editor.concretes["EditorFre"].rule("_8", cs)), new Int(1));}, Parse: function(cs){return new Arr(new Suffix("analys", Editor.concretes["EditorFre"].rule("_95", cs)), new Int(0));}, Paste: function(cs){return new Arr(new Suffix("coll", Editor.concretes["EditorFre"].rule("_95", cs)), new Int(0));}, Previous: function(cs){return new Arr(new Arr(new Suffix("précédent", Editor.concretes["EditorFre"].rule("_163", cs)), Editor.concretes["EditorFre"].rule("_189", cs), Editor.concretes["EditorFre"].rule("_189", cs)), new Int(1));}, RandomlyCommand: function(cs){return new Arr(new Seq(Editor.concretes["EditorFre"].rule("_41", cs), Editor.concretes["EditorFre"].rule("_43", cs), Editor.concretes["EditorFre"].rule("_45", cs), Editor.concretes["EditorFre"].rule("_58", cs), new Str("aléatoirement")));}, Redo: function(cs){return new Arr(new Suffix("ref", new Arr(new Str("aire"), new Str("aire"), new Str("ais"), new Str("ais"), new Str("ait"), new Str("aisons"), new Str("aites"), new Str("ont"), new Str("asse"), new Str("asses"), new Str("asse"), new Str("assions"), new Str("assiez"), new Str("assent"), new Str("ais"), new Str("aisons"), new Str("aites"), new Str("ait"), new Str("aits"), new Str("aite"), new Str("aites"), new Str("aisant"))), new Int(0));}, Refine: function(cs){return new Arr(new Suffix("raffin", Editor.concretes["EditorFre"].rule("_95", cs)), new Int(0));}, Refinement: function(cs){return new Arr(new Suffix("raffinement", Editor.concretes["EditorFre"].rule("_8", cs)), new Int(0));}, Replace: function(cs){return new Arr(new Suffix("rempla", new Arr(new Str("cer"), new Str("cer"), new Str("ce"), new Str("ces"), new Str("ce"), new Str("çons"), new Str("cez"), new Str("cent"), new Str("ce"), new Str("ces"), new Str("ce"), new Str("cions"), new Str("ciez"), new Str("cent"), new Str("ce"), new Str("çons"), new Str("cez"), new Str("cé"), new Str("cés"), new Str("cée"), new Str("cées"), new Str("çant"))), new Int(0));}, Russian: function(cs){return new Arr(new Suffix("russe", Editor.concretes["EditorFre"].rule("_8", cs)), new Int(1));}, Select: function(cs){return new Arr(new Suffix("selectionn", Editor.concretes["EditorFre"].rule("_95", cs)), new Int(0));}, Show: function(cs){return new Arr(new Suffix("montr", Editor.concretes["EditorFre"].rule("_95", cs)), new Int(0));}, SingleWordCommand: function(cs){return new Arr(new Seq(Editor.concretes["EditorFre"].rule("_12", cs).sel(Editor.concretes["EditorFre"].rule("_20", cs)), Editor.concretes["EditorFre"].rule("_43", cs)));}, Spanish: function(cs){return new Arr(new Suffix("espagnol", Editor.concretes["EditorFre"].rule("_8", cs)), new Int(0));}, String_N: function(cs){return new Arr(new Arr(new Seq(new Str("chaîne"), new Str("de"), new Str("charactères")), new Seq(new Str("chaînes"), new Str("de"), new Str("charactères"))), new Int(1));}, Swedish: function(cs){return new Arr(new Suffix("suédois", Editor.concretes["EditorFre"].rule("_100", cs)), new Int(0));}, Tree: function(cs){return new Arr(new Suffix("arbre", Editor.concretes["EditorFre"].rule("_8", cs)), new Int(0));}, Undo: function(cs){return new Arr(new Suffix("annul", Editor.concretes["EditorFre"].rule("_95", cs)), new Int(0));}, Wrap: function(cs){return new Arr(new Suffix("emball", Editor.concretes["EditorFre"].rule("_95", cs)), new Int(0));}, Wrapper: function(cs){return new Arr(new Suffix("emballage", Editor.concretes["EditorFre"].rule("_8", cs)), new Int(1));}, _100: function(cs){return new Arr(new Str(""), new Str(""));}, _103: function(cs){return new Arr(new Str("le"), new Str("le"), new Str("du"), new Str("au"), new Str("le"));}, _104: function(cs){return new Seq(new Str("de"), new Str("la"));}, _105: function(cs){return new Seq(new Str("Ã"), new Str("la"));}, _106: function(cs){return new Arr(new Str("la"), new Str("la"), Editor.concretes["EditorFre"].rule("_104", cs), Editor.concretes["EditorFre"].rule("_105", cs), new Str("la"));}, _107: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_103", cs), Editor.concretes["EditorFre"].rule("_106", cs));}, _108: function(cs){return new Arr(new Str("les"), new Str("les"), new Str("des"), new Str("aux"), new Str("les"));}, _109: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_108", cs), Editor.concretes["EditorFre"].rule("_108", cs));}, _11: function(cs){return new Seq();}, _110: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_107", cs), Editor.concretes["EditorFre"].rule("_109", cs));}, _111: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_110", cs), Editor.concretes["EditorFre"].rule("_110", cs));}, _112: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_111", cs));}, _12: function(cs){return new Arr(new Str("me"), new Str("te"), new Str("le"), new Str("nous"), new Str("vous"), new Str("les"), new Str("me"), new Str("te"), new Str("la"), new Str("nous"), new Str("vous"), new Str("les"), new Str("se"), Editor.concretes["EditorFre"].rule("_11", cs));}, _121: function(cs){return cs[1].sel(new Int(1));}, _123: function(cs){return new Arr(new Int(1), new Int(3));}, _124: function(cs){return Editor.concretes["EditorFre"].rule("_123", cs).sel(Editor.concretes["EditorFre"].rule("_121", cs));}, _125: function(cs){return Editor.concretes["EditorFre"].rule("_43", cs).sel(Editor.concretes["EditorFre"].rule("_124", cs));}, _13: function(cs){return new Arr(new Int(2), new Int(8));}, _14: function(cs){return cs[2].sel(new Int(1));}, _140: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_11", cs));}, _141: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_140", cs), Editor.concretes["EditorFre"].rule("_140", cs));}, _142: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_141", cs), Editor.concretes["EditorFre"].rule("_141", cs));}, _143: function(cs){return new Seq(new Str("d'"), new Str("un"));}, _144: function(cs){return new Seq(new Str("Ã"), new Str("un"));}, _145: function(cs){return new Arr(new Str("un"), new Str("un"), Editor.concretes["EditorFre"].rule("_143", cs), Editor.concretes["EditorFre"].rule("_144", cs), new Str("un"));}, _146: function(cs){return new Seq(new Str("d'"), new Str("une"));}, _147: function(cs){return new Seq(new Str("Ã"), new Str("une"));}, _148: function(cs){return new Arr(new Str("une"), new Str("une"), Editor.concretes["EditorFre"].rule("_146", cs), Editor.concretes["EditorFre"].rule("_147", cs), new Str("une"));}, _149: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_145", cs), Editor.concretes["EditorFre"].rule("_148", cs));}, _15: function(cs){return Editor.concretes["EditorFre"].rule("_13", cs).sel(Editor.concretes["EditorFre"].rule("_14", cs));}, _150: function(cs){return new Seq(new Str("Ã"), new Str("des"));}, _151: function(cs){return new Arr(new Str("des"), new Str("des"), new Str("de"), Editor.concretes["EditorFre"].rule("_150", cs), new Str("des"));}, _152: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_151", cs), Editor.concretes["EditorFre"].rule("_151", cs));}, _153: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_149", cs), Editor.concretes["EditorFre"].rule("_152", cs));}, _154: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_142", cs), Editor.concretes["EditorFre"].rule("_153", cs));}, _155: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_154", cs));}, _16: function(cs){return new Arr(new Int(12), new Int(13));}, _163: function(cs){return new Arr(new Str(""), new Str("s"), new Str("e"), new Str("es"), new Str("ement"));}, _165: function(cs){return new Seq(new Str("plus"), new Str("prochain"));}, _166: function(cs){return new Seq(new Str("plus"), new Str("prochains"));}, _167: function(cs){return new Seq(new Str("plus"), new Str("prochaine"));}, _168: function(cs){return new Seq(new Str("plus"), new Str("prochaines"));}, _169: function(cs){return new Seq(new Str("plus"), new Str("prochainement"));}, _17: function(cs){return new Arr(new Int(1), new Int(1), new Int(0));}, _170: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_165", cs), Editor.concretes["EditorFre"].rule("_166", cs), Editor.concretes["EditorFre"].rule("_167", cs), Editor.concretes["EditorFre"].rule("_168", cs), Editor.concretes["EditorFre"].rule("_169", cs));}, _18: function(cs){return cs[0].sel(new Int(1));}, _184: function(cs){return new Seq(new Str("plus"), new Str("précédent"));}, _185: function(cs){return new Seq(new Str("plus"), new Str("précédents"));}, _186: function(cs){return new Seq(new Str("plus"), new Str("précédente"));}, _187: function(cs){return new Seq(new Str("plus"), new Str("précédentes"));}, _188: function(cs){return new Seq(new Str("plus"), new Str("précédentement"));}, _189: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_184", cs), Editor.concretes["EditorFre"].rule("_185", cs), Editor.concretes["EditorFre"].rule("_186", cs), Editor.concretes["EditorFre"].rule("_187", cs), Editor.concretes["EditorFre"].rule("_188", cs));}, _19: function(cs){return Editor.concretes["EditorFre"].rule("_17", cs).sel(Editor.concretes["EditorFre"].rule("_18", cs));}, _2: function(cs){return new Seq(new Str("plus"), new Str("disponible"));}, _20: function(cs){return Editor.concretes["EditorFre"].rule("_16", cs).sel(Editor.concretes["EditorFre"].rule("_19", cs));}, _21: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_15", cs), Editor.concretes["EditorFre"].rule("_20", cs));}, _22: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_20", cs), Editor.concretes["EditorFre"].rule("_20", cs));}, _229: function(cs){return new Arr(cs[0], cs[0], cs[0], cs[0], cs[0]);}, _23: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_21", cs), Editor.concretes["EditorFre"].rule("_22", cs));}, _232: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_229", cs), Editor.concretes["EditorFre"].rule("_229", cs));}, _233: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_232", cs), Editor.concretes["EditorFre"].rule("_232", cs));}, _24: function(cs){return new Arr(new Int(1), new Int(0));}, _25: function(cs){return Editor.concretes["EditorFre"].rule("_24", cs).sel(new Int(0));}, _26: function(cs){return Editor.concretes["EditorFre"].rule("_23", cs).sel(Editor.concretes["EditorFre"].rule("_25", cs));}, _27: function(cs){return Editor.concretes["EditorFre"].rule("_24", cs).sel(new Int(1));}, _28: function(cs){return Editor.concretes["EditorFre"].rule("_26", cs).sel(Editor.concretes["EditorFre"].rule("_27", cs));}, _29: function(cs){return Editor.concretes["EditorFre"].rule("_12", cs).sel(Editor.concretes["EditorFre"].rule("_28", cs));}, _3: function(cs){return new Seq(new Str("plus"), new Str("disponibles"));}, _30: function(cs){return new Seq(new Str("me"), Editor.concretes["EditorFre"].rule("_29", cs));}, _31: function(cs){return new Seq(new Str("te"), Editor.concretes["EditorFre"].rule("_29", cs));}, _32: function(cs){return new Seq(Editor.concretes["EditorFre"].rule("_29", cs), new Str("lui"));}, _33: function(cs){return new Seq(new Str("nous"), Editor.concretes["EditorFre"].rule("_29", cs));}, _34: function(cs){return new Seq(new Str("vous"), Editor.concretes["EditorFre"].rule("_29", cs));}, _35: function(cs){return new Seq(Editor.concretes["EditorFre"].rule("_29", cs), new Str("leur"));}, _36: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_30", cs), Editor.concretes["EditorFre"].rule("_31", cs), Editor.concretes["EditorFre"].rule("_32", cs), Editor.concretes["EditorFre"].rule("_33", cs), Editor.concretes["EditorFre"].rule("_34", cs), Editor.concretes["EditorFre"].rule("_35", cs), Editor.concretes["EditorFre"].rule("_30", cs), Editor.concretes["EditorFre"].rule("_31", cs), Editor.concretes["EditorFre"].rule("_32", cs), Editor.concretes["EditorFre"].rule("_33", cs), Editor.concretes["EditorFre"].rule("_34", cs), Editor.concretes["EditorFre"].rule("_35", cs), Editor.concretes["EditorFre"].rule("_29", cs), Editor.concretes["EditorFre"].rule("_29", cs));}, _37: function(cs){return new Arr(new Int(13), new Int(13));}, _38: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_37", cs), Editor.concretes["EditorFre"].rule("_37", cs));}, _39: function(cs){return Editor.concretes["EditorFre"].rule("_38", cs).sel(Editor.concretes["EditorFre"].rule("_25", cs));}, _4: function(cs){return new Seq(new Str("plus"), new Str("disponiblement"));}, _40: function(cs){return Editor.concretes["EditorFre"].rule("_39", cs).sel(Editor.concretes["EditorFre"].rule("_27", cs));}, _41: function(cs){return Editor.concretes["EditorFre"].rule("_36", cs).sel(Editor.concretes["EditorFre"].rule("_40", cs));}, _42: function(cs){return cs[0].sel(new Int(0));}, _43: function(cs){return Editor.concretes["EditorFre"].rule("_42", cs).sel(new Int(0));}, _44: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_11", cs));}, _45: function(cs){return Editor.concretes["EditorFre"].rule("_44", cs).sel(Editor.concretes["EditorFre"].rule("_40", cs));}, _46: function(cs){return cs[1].sel(new Int(0));}, _47: function(cs){return Editor.concretes["EditorFre"].rule("_46", cs).sel(new Int(1));}, _48: function(cs){return Editor.concretes["EditorFre"].rule("_47", cs).sel(new Int(0));}, _49: function(cs){return Editor.concretes["EditorFre"].rule("_48", cs).sel(Editor.concretes["EditorFre"].rule("_14", cs));}, _5: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_2", cs), Editor.concretes["EditorFre"].rule("_3", cs), Editor.concretes["EditorFre"].rule("_2", cs), Editor.concretes["EditorFre"].rule("_3", cs), Editor.concretes["EditorFre"].rule("_4", cs));}, _50: function(cs){return Editor.concretes["EditorFre"].rule("_49", cs).sel(new Int(1));}, _51: function(cs){return cs[2].sel(new Int(0));}, _52: function(cs){return Editor.concretes["EditorFre"].rule("_51", cs).sel(new Int(0));}, _53: function(cs){return new Seq(Editor.concretes["EditorFre"].rule("_50", cs), Editor.concretes["EditorFre"].rule("_52", cs));}, _54: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_11", cs), Editor.concretes["EditorFre"].rule("_53", cs));}, _55: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_53", cs), Editor.concretes["EditorFre"].rule("_53", cs));}, _56: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_54", cs), Editor.concretes["EditorFre"].rule("_55", cs));}, _57: function(cs){return Editor.concretes["EditorFre"].rule("_56", cs).sel(Editor.concretes["EditorFre"].rule("_25", cs));}, _58: function(cs){return Editor.concretes["EditorFre"].rule("_57", cs).sel(Editor.concretes["EditorFre"].rule("_27", cs));}, _61: function(cs){return cs[3].sel(new Int(1));}, _62: function(cs){return Editor.concretes["EditorFre"].rule("_13", cs).sel(Editor.concretes["EditorFre"].rule("_61", cs));}, _63: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_62", cs), Editor.concretes["EditorFre"].rule("_20", cs));}, _64: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_63", cs), Editor.concretes["EditorFre"].rule("_22", cs));}, _65: function(cs){return Editor.concretes["EditorFre"].rule("_64", cs).sel(Editor.concretes["EditorFre"].rule("_25", cs));}, _66: function(cs){return Editor.concretes["EditorFre"].rule("_65", cs).sel(Editor.concretes["EditorFre"].rule("_27", cs));}, _67: function(cs){return Editor.concretes["EditorFre"].rule("_12", cs).sel(Editor.concretes["EditorFre"].rule("_66", cs));}, _68: function(cs){return new Seq(new Str("me"), Editor.concretes["EditorFre"].rule("_67", cs));}, _69: function(cs){return new Seq(new Str("te"), Editor.concretes["EditorFre"].rule("_67", cs));}, _70: function(cs){return new Seq(Editor.concretes["EditorFre"].rule("_67", cs), new Str("lui"));}, _71: function(cs){return new Seq(new Str("nous"), Editor.concretes["EditorFre"].rule("_67", cs));}, _72: function(cs){return new Seq(new Str("vous"), Editor.concretes["EditorFre"].rule("_67", cs));}, _73: function(cs){return new Seq(Editor.concretes["EditorFre"].rule("_67", cs), new Str("leur"));}, _76: function(cs){return Editor.concretes["EditorFre"].rule("_48", cs).sel(Editor.concretes["EditorFre"].rule("_61", cs));}, _77: function(cs){return Editor.concretes["EditorFre"].rule("_76", cs).sel(new Int(1));}, _78: function(cs){return new Arr(new Int(0), new Int(2));}, _79: function(cs){return Editor.concretes["EditorFre"].rule("_78", cs).sel(Editor.concretes["EditorFre"].rule("_61", cs));}, _8: function(cs){return new Arr(new Str(""), new Str("s"));}, _80: function(cs){return Editor.concretes["EditorFre"].rule("_52", cs).sel(Editor.concretes["EditorFre"].rule("_79", cs));}, _81: function(cs){return cs[3].sel(new Int(0));}, _82: function(cs){return Editor.concretes["EditorFre"].rule("_81", cs).sel(new Int(0));}, _83: function(cs){return new Seq(Editor.concretes["EditorFre"].rule("_80", cs), Editor.concretes["EditorFre"].rule("_82", cs));}, _84: function(cs){return new Seq(Editor.concretes["EditorFre"].rule("_82", cs), Editor.concretes["EditorFre"].rule("_80", cs));}, _85: function(cs){return new Arr(Editor.concretes["EditorFre"].rule("_83", cs), Editor.concretes["EditorFre"].rule("_84", cs));}, _86: function(cs){return Editor.concretes["EditorFre"].rule("_85", cs).sel(Editor.concretes["EditorFre"].rule("_14", cs));}, _87: function(cs){return new Seq(Editor.concretes["EditorFre"].rule("_77", cs), Editor.concretes["EditorFre"].rule("_86", cs));}, _95: function(cs){return new Arr(new Str("er"), new Str("er"), new Str("e"), new Str("es"), new Str("e"), new Str("ons"), new Str("ez"), new Str("ent"), new Str("e"), new Str("es"), new Str("e"), new Str("ions"), new Str("iez"), new Str("ent"), new Str("e"), new Str("ons"), new Str("ez"), new Str("é"), new Str("és"), new Str("ée"), new Str("ées"), new Str("ant"));}, Adjective: function(cs){return new Arr(new Arr(Editor.concretes["EditorFre"].rule("_229", cs), Editor.concretes["EditorFre"].rule("_229", cs), Editor.concretes["EditorFre"].rule("_229", cs)), new Int(0));}, Determiner: function(cs){return new Arr(new Arr(Editor.concretes["EditorFre"].rule("_233", cs), Editor.concretes["EditorFre"].rule("_233", cs)));}, Noun: function(cs){return new Arr(new Arr(cs[0], cs[0]), new Int(0));}, Sentence: function(cs){return new Arr(cs[0]);}, Verb: function(cs){return new Arr(new Arr(cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0]), new Int(0));}, "Int": function(cs){return new Arr(cs[0]);}, "Float": function(cs){return new Arr(cs[0]);}, "String": function(cs){return new Arr(cs[0]);}}, new Parser("Sentence",[new Rule(23, new FunApp("Wrapper",[]),[],[[new Terminal("emballage")]]), new Rule(87, new FunApp("Wrapper",[]),[],[[new Terminal("emballages")]]), new Rule(20, new FunApp("Wrap",[]),[],[[new Terminal("emballer")]]), new Rule(47, new FunApp("Wrap",[]),[],[[new Terminal("emballer")]]), new Rule(46, new FunApp("Wrap",[]),[],[[new Terminal("emballe")]]), new Rule(45, new FunApp("Wrap",[]),[],[[new Terminal("emballes")]]), new Rule(44, new FunApp("Wrap",[]),[],[[new Terminal("emballe")]]), new Rule(43, new FunApp("Wrap",[]),[],[[new Terminal("emballons")]]), new Rule(42, new FunApp("Wrap",[]),[],[[new Terminal("emballez")]]), new Rule(41, new FunApp("Wrap",[]),[],[[new Terminal("emballent")]]), new Rule(40, new FunApp("Wrap",[]),[],[[new Terminal("emballe")]]), new Rule(39, new FunApp("Wrap",[]),[],[[new Terminal("emballes")]]), new Rule(38, new FunApp("Wrap",[]),[],[[new Terminal("emballe")]]), new Rule(37, new FunApp("Wrap",[]),[],[[new Terminal("emballions")]]), new Rule(36, new FunApp("Wrap",[]),[],[[new Terminal("emballiez")]]), new Rule(35, new FunApp("Wrap",[]),[],[[new Terminal("emballent")]]), new Rule(34, new FunApp("Wrap",[]),[],[[new Terminal("emballe")]]), new Rule(33, new FunApp("Wrap",[]),[],[[new Terminal("emballons")]]), new Rule(32, new FunApp("Wrap",[]),[],[[new Terminal("emballez")]]), new Rule(31, new FunApp("Wrap",[]),[],[[new Terminal("emballé")]]), new Rule(30, new FunApp("Wrap",[]),[],[[new Terminal("emballés")]]), new Rule(29, new FunApp("Wrap",[]),[],[[new Terminal("emballée")]]), new Rule(28, new FunApp("Wrap",[]),[],[[new Terminal("emballées")]]), new Rule(27, new FunApp("Wrap",[]),[],[[new Terminal("emballant")]]), new Rule(20, new FunApp("Undo",[]),[],[[new Terminal("annuler")]]), new Rule(47, new FunApp("Undo",[]),[],[[new Terminal("annuler")]]), new Rule(46, new FunApp("Undo",[]),[],[[new Terminal("annule")]]), new Rule(45, new FunApp("Undo",[]),[],[[new Terminal("annules")]]), new Rule(44, new FunApp("Undo",[]),[],[[new Terminal("annule")]]), new Rule(43, new FunApp("Undo",[]),[],[[new Terminal("annulons")]]), new Rule(42, new FunApp("Undo",[]),[],[[new Terminal("annulez")]]), new Rule(41, new FunApp("Undo",[]),[],[[new Terminal("annulent")]]), new Rule(40, new FunApp("Undo",[]),[],[[new Terminal("annule")]]), new Rule(39, new FunApp("Undo",[]),[],[[new Terminal("annules")]]), new Rule(38, new FunApp("Undo",[]),[],[[new Terminal("annule")]]), new Rule(37, new FunApp("Undo",[]),[],[[new Terminal("annulions")]]), new Rule(36, new FunApp("Undo",[]),[],[[new Terminal("annuliez")]]), new Rule(35, new FunApp("Undo",[]),[],[[new Terminal("annulent")]]), new Rule(34, new FunApp("Undo",[]),[],[[new Terminal("annule")]]), new Rule(33, new FunApp("Undo",[]),[],[[new Terminal("annulons")]]), new Rule(32, new FunApp("Undo",[]),[],[[new Terminal("annulez")]]), new Rule(31, new FunApp("Undo",[]),[],[[new Terminal("annulé")]]), new Rule(30, new FunApp("Undo",[]),[],[[new Terminal("annulés")]]), new Rule(29, new FunApp("Undo",[]),[],[[new Terminal("annulée")]]), new Rule(28, new FunApp("Undo",[]),[],[[new Terminal("annulées")]]), new Rule(27, new FunApp("Undo",[]),[],[[new Terminal("annulant")]]), new Rule(17, new FunApp("Tree",[]),[],[[new Terminal("arbre")]]), new Rule(16, new FunApp("Tree",[]),[],[[new Terminal("arbres")]]), new Rule(17, new FunApp("Swedish",[]),[],[[new Terminal("suédois")]]), new Rule(16, new FunApp("Swedish",[]),[],[[new Terminal("suédois")]]), new Rule(23, new FunApp("String_N",[]),[],[[new Terminal("chaîne"), new Terminal("de"), new Terminal("charactères")]]), new Rule(87, new FunApp("String_N",[]),[],[[new Terminal("chaînes"), new Terminal("de"), new Terminal("charactères")]]), new Rule(17, new FunApp("Spanish",[]),[],[[new Terminal("espagnol")]]), new Rule(16, new FunApp("Spanish",[]),[],[[new Terminal("espagnols")]]), new Rule(18, new FunApp("SingleWordCommand",[new Arg(0)]),[22],[[new Terminal("s'"), new ArgProj(0, 0)]]), new Rule(18, new FunApp("SingleWordCommand",[new Arg(0)]),[22],[[new Terminal("se"), new ArgProj(0, 0)]]), new Rule(18, new FunApp("SingleWordCommand",[new Arg(0)]),[21],[[new ArgProj(0, 0)]]), new Rule(18, new FunApp("SingleWordCommand",[new Arg(0)]),[20],[[new ArgProj(0, 0)]]), new Rule(20, new FunApp("Show",[]),[],[[new Terminal("montrer")]]), new Rule(47, new FunApp("Show",[]),[],[[new Terminal("montrer")]]), new Rule(46, new FunApp("Show",[]),[],[[new Terminal("montre")]]), new Rule(45, new FunApp("Show",[]),[],[[new Terminal("montres")]]), new Rule(44, new FunApp("Show",[]),[],[[new Terminal("montre")]]), new Rule(43, new FunApp("Show",[]),[],[[new Terminal("montrons")]]), new Rule(42, new FunApp("Show",[]),[],[[new Terminal("montrez")]]), new Rule(41, new FunApp("Show",[]),[],[[new Terminal("montrent")]]), new Rule(40, new FunApp("Show",[]),[],[[new Terminal("montre")]]), new Rule(39, new FunApp("Show",[]),[],[[new Terminal("montres")]]), new Rule(38, new FunApp("Show",[]),[],[[new Terminal("montre")]]), new Rule(37, new FunApp("Show",[]),[],[[new Terminal("montrions")]]), new Rule(36, new FunApp("Show",[]),[],[[new Terminal("montriez")]]), new Rule(35, new FunApp("Show",[]),[],[[new Terminal("montrent")]]), new Rule(34, new FunApp("Show",[]),[],[[new Terminal("montre")]]), new Rule(33, new FunApp("Show",[]),[],[[new Terminal("montrons")]]), new Rule(32, new FunApp("Show",[]),[],[[new Terminal("montrez")]]), new Rule(31, new FunApp("Show",[]),[],[[new Terminal("montré")]]), new Rule(30, new FunApp("Show",[]),[],[[new Terminal("montrés")]]), new Rule(29, new FunApp("Show",[]),[],[[new Terminal("montrée")]]), new Rule(28, new FunApp("Show",[]),[],[[new Terminal("montrées")]]), new Rule(27, new FunApp("Show",[]),[],[[new Terminal("montrant")]]), new Rule(20, new FunApp("Select",[]),[],[[new Terminal("selectionner")]]), new Rule(47, new FunApp("Select",[]),[],[[new Terminal("selectionner")]]), new Rule(46, new FunApp("Select",[]),[],[[new Terminal("selectionne")]]), new Rule(45, new FunApp("Select",[]),[],[[new Terminal("selectionnes")]]), new Rule(44, new FunApp("Select",[]),[],[[new Terminal("selectionne")]]), new Rule(43, new FunApp("Select",[]),[],[[new Terminal("selectionnons")]]), new Rule(42, new FunApp("Select",[]),[],[[new Terminal("selectionnez")]]), new Rule(41, new FunApp("Select",[]),[],[[new Terminal("selectionnent")]]), new Rule(40, new FunApp("Select",[]),[],[[new Terminal("selectionne")]]), new Rule(39, new FunApp("Select",[]),[],[[new Terminal("selectionnes")]]), new Rule(38, new FunApp("Select",[]),[],[[new Terminal("selectionne")]]), new Rule(37, new FunApp("Select",[]),[],[[new Terminal("selectionnions")]]), new Rule(36, new FunApp("Select",[]),[],[[new Terminal("selectionniez")]]), new Rule(35, new FunApp("Select",[]),[],[[new Terminal("selectionnent")]]), new Rule(34, new FunApp("Select",[]),[],[[new Terminal("selectionne")]]), new Rule(33, new FunApp("Select",[]),[],[[new Terminal("selectionnons")]]), new Rule(32, new FunApp("Select",[]),[],[[new Terminal("selectionnez")]]), new Rule(31, new FunApp("Select",[]),[],[[new Terminal("selectionné")]]), new Rule(30, new FunApp("Select",[]),[],[[new Terminal("selectionnés")]]), new Rule(29, new FunApp("Select",[]),[],[[new Terminal("selectionnée")]]), new Rule(28, new FunApp("Select",[]),[],[[new Terminal("selectionnées")]]), new Rule(27, new FunApp("Select",[]),[],[[new Terminal("selectionnant")]]), new Rule(23, new FunApp("Russian",[]),[],[[new Terminal("russe")]]), new Rule(87, new FunApp("Russian",[]),[],[[new Terminal("russes")]]), new Rule(20, new FunApp("Replace",[]),[],[[new Terminal("remplacer")]]), new Rule(47, new FunApp("Replace",[]),[],[[new Terminal("remplacer")]]), new Rule(46, new FunApp("Replace",[]),[],[[new Terminal("remplace")]]), new Rule(45, new FunApp("Replace",[]),[],[[new Terminal("remplaces")]]), new Rule(44, new FunApp("Replace",[]),[],[[new Terminal("remplace")]]), new Rule(43, new FunApp("Replace",[]),[],[[new Terminal("remplaçons")]]), new Rule(42, new FunApp("Replace",[]),[],[[new Terminal("remplacez")]]), new Rule(41, new FunApp("Replace",[]),[],[[new Terminal("remplacent")]]), new Rule(40, new FunApp("Replace",[]),[],[[new Terminal("remplace")]]), new Rule(39, new FunApp("Replace",[]),[],[[new Terminal("remplaces")]]), new Rule(38, new FunApp("Replace",[]),[],[[new Terminal("remplace")]]), new Rule(37, new FunApp("Replace",[]),[],[[new Terminal("remplacions")]]), new Rule(36, new FunApp("Replace",[]),[],[[new Terminal("remplaciez")]]), new Rule(35, new FunApp("Replace",[]),[],[[new Terminal("remplacent")]]), new Rule(34, new FunApp("Replace",[]),[],[[new Terminal("remplace")]]), new Rule(33, new FunApp("Replace",[]),[],[[new Terminal("remplaçons")]]), new Rule(32, new FunApp("Replace",[]),[],[[new Terminal("remplacez")]]), new Rule(31, new FunApp("Replace",[]),[],[[new Terminal("remplacé")]]), new Rule(30, new FunApp("Replace",[]),[],[[new Terminal("remplacés")]]), new Rule(29, new FunApp("Replace",[]),[],[[new Terminal("remplacée")]]), new Rule(28, new FunApp("Replace",[]),[],[[new Terminal("remplacées")]]), new Rule(27, new FunApp("Replace",[]),[],[[new Terminal("remplaçant")]]), new Rule(17, new FunApp("Refinement",[]),[],[[new Terminal("raffinement")]]), new Rule(16, new FunApp("Refinement",[]),[],[[new Terminal("raffinements")]]), new Rule(20, new FunApp("Refine",[]),[],[[new Terminal("raffiner")]]), new Rule(47, new FunApp("Refine",[]),[],[[new Terminal("raffiner")]]), new Rule(46, new FunApp("Refine",[]),[],[[new Terminal("raffine")]]), new Rule(45, new FunApp("Refine",[]),[],[[new Terminal("raffines")]]), new Rule(44, new FunApp("Refine",[]),[],[[new Terminal("raffine")]]), new Rule(43, new FunApp("Refine",[]),[],[[new Terminal("raffinons")]]), new Rule(42, new FunApp("Refine",[]),[],[[new Terminal("raffinez")]]), new Rule(41, new FunApp("Refine",[]),[],[[new Terminal("raffinent")]]), new Rule(40, new FunApp("Refine",[]),[],[[new Terminal("raffine")]]), new Rule(39, new FunApp("Refine",[]),[],[[new Terminal("raffines")]]), new Rule(38, new FunApp("Refine",[]),[],[[new Terminal("raffine")]]), new Rule(37, new FunApp("Refine",[]),[],[[new Terminal("raffinions")]]), new Rule(36, new FunApp("Refine",[]),[],[[new Terminal("raffiniez")]]), new Rule(35, new FunApp("Refine",[]),[],[[new Terminal("raffinent")]]), new Rule(34, new FunApp("Refine",[]),[],[[new Terminal("raffine")]]), new Rule(33, new FunApp("Refine",[]),[],[[new Terminal("raffinons")]]), new Rule(32, new FunApp("Refine",[]),[],[[new Terminal("raffinez")]]), new Rule(31, new FunApp("Refine",[]),[],[[new Terminal("raffiné")]]), new Rule(30, new FunApp("Refine",[]),[],[[new Terminal("raffinés")]]), new Rule(29, new FunApp("Refine",[]),[],[[new Terminal("raffinée")]]), new Rule(28, new FunApp("Refine",[]),[],[[new Terminal("raffinées")]]), new Rule(27, new FunApp("Refine",[]),[],[[new Terminal("raffinant")]]), new Rule(20, new FunApp("Redo",[]),[],[[new Terminal("refaire")]]), new Rule(47, new FunApp("Redo",[]),[],[[new Terminal("refaire")]]), new Rule(46, new FunApp("Redo",[]),[],[[new Terminal("refais")]]), new Rule(45, new FunApp("Redo",[]),[],[[new Terminal("refais")]]), new Rule(44, new FunApp("Redo",[]),[],[[new Terminal("refait")]]), new Rule(43, new FunApp("Redo",[]),[],[[new Terminal("refaisons")]]), new Rule(42, new FunApp("Redo",[]),[],[[new Terminal("refaites")]]), new Rule(41, new FunApp("Redo",[]),[],[[new Terminal("refont")]]), new Rule(40, new FunApp("Redo",[]),[],[[new Terminal("refasse")]]), new Rule(39, new FunApp("Redo",[]),[],[[new Terminal("refasses")]]), new Rule(38, new FunApp("Redo",[]),[],[[new Terminal("refasse")]]), new Rule(37, new FunApp("Redo",[]),[],[[new Terminal("refassions")]]), new Rule(36, new FunApp("Redo",[]),[],[[new Terminal("refassiez")]]), new Rule(35, new FunApp("Redo",[]),[],[[new Terminal("refassent")]]), new Rule(34, new FunApp("Redo",[]),[],[[new Terminal("refais")]]), new Rule(33, new FunApp("Redo",[]),[],[[new Terminal("refaisons")]]), new Rule(32, new FunApp("Redo",[]),[],[[new Terminal("refaites")]]), new Rule(31, new FunApp("Redo",[]),[],[[new Terminal("refait")]]), new Rule(30, new FunApp("Redo",[]),[],[[new Terminal("refaits")]]), new Rule(29, new FunApp("Redo",[]),[],[[new Terminal("refaite")]]), new Rule(28, new FunApp("Redo",[]),[],[[new Terminal("refaites")]]), new Rule(27, new FunApp("Redo",[]),[],[[new Terminal("refaisant")]]), new Rule(18, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[22, 24, 23],[[new Terminal("s'"), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("aléatoirement")]]), new Rule(18, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[22, 24, 23],[[new Terminal("se"), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("aléatoirement")]]), new Rule(18, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[21, 24, 23],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("aléatoirement")]]), new Rule(18, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[20, 24, 23],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("aléatoirement")]]), new Rule(18, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[22, 19, 17],[[new Terminal("s'"), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("aléatoirement")]]), new Rule(18, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[22, 19, 17],[[new Terminal("se"), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("aléatoirement")]]), new Rule(18, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[21, 19, 17],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("aléatoirement")]]), new Rule(18, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[20, 19, 17],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("aléatoirement")]]), new Rule(15, new FunApp("Previous",[]),[],[[new Terminal("précédent")]]), new Rule(14, new FunApp("Previous",[]),[],[[new Terminal("précédents")]]), new Rule(13, new FunApp("Previous",[]),[],[[new Terminal("précédente")]]), new Rule(12, new FunApp("Previous",[]),[],[[new Terminal("précédentes")]]), new Rule(11, new FunApp("Previous",[]),[],[[new Terminal("précédentement")]]), new Rule(10, new FunApp("Previous",[]),[],[[new Terminal("plus"), new Terminal("précédent")]]), new Rule(9, new FunApp("Previous",[]),[],[[new Terminal("plus"), new Terminal("précédents")]]), new Rule(8, new FunApp("Previous",[]),[],[[new Terminal("plus"), new Terminal("précédente")]]), new Rule(7, new FunApp("Previous",[]),[],[[new Terminal("plus"), new Terminal("précédentes")]]), new Rule(6, new FunApp("Previous",[]),[],[[new Terminal("plus"), new Terminal("précédentement")]]), new Rule(5, new FunApp("Previous",[]),[],[[new Terminal("plus"), new Terminal("précédent")]]), new Rule(4, new FunApp("Previous",[]),[],[[new Terminal("plus"), new Terminal("précédents")]]), new Rule(3, new FunApp("Previous",[]),[],[[new Terminal("plus"), new Terminal("précédente")]]), new Rule(2, new FunApp("Previous",[]),[],[[new Terminal("plus"), new Terminal("précédentes")]]), new Rule(1, new FunApp("Previous",[]),[],[[new Terminal("plus"), new Terminal("précédentement")]]), new Rule(20, new FunApp("Paste",[]),[],[[new Terminal("coller")]]), new Rule(47, new FunApp("Paste",[]),[],[[new Terminal("coller")]]), new Rule(46, new FunApp("Paste",[]),[],[[new Terminal("colle")]]), new Rule(45, new FunApp("Paste",[]),[],[[new Terminal("colles")]]), new Rule(44, new FunApp("Paste",[]),[],[[new Terminal("colle")]]), new Rule(43, new FunApp("Paste",[]),[],[[new Terminal("collons")]]), new Rule(42, new FunApp("Paste",[]),[],[[new Terminal("collez")]]), new Rule(41, new FunApp("Paste",[]),[],[[new Terminal("collent")]]), new Rule(40, new FunApp("Paste",[]),[],[[new Terminal("colle")]]), new Rule(39, new FunApp("Paste",[]),[],[[new Terminal("colles")]]), new Rule(38, new FunApp("Paste",[]),[],[[new Terminal("colle")]]), new Rule(37, new FunApp("Paste",[]),[],[[new Terminal("collions")]]), new Rule(36, new FunApp("Paste",[]),[],[[new Terminal("colliez")]]), new Rule(35, new FunApp("Paste",[]),[],[[new Terminal("collent")]]), new Rule(34, new FunApp("Paste",[]),[],[[new Terminal("colle")]]), new Rule(33, new FunApp("Paste",[]),[],[[new Terminal("collons")]]), new Rule(32, new FunApp("Paste",[]),[],[[new Terminal("collez")]]), new Rule(31, new FunApp("Paste",[]),[],[[new Terminal("collé")]]), new Rule(30, new FunApp("Paste",[]),[],[[new Terminal("collés")]]), new Rule(29, new FunApp("Paste",[]),[],[[new Terminal("collée")]]), new Rule(28, new FunApp("Paste",[]),[],[[new Terminal("collées")]]), new Rule(27, new FunApp("Paste",[]),[],[[new Terminal("collant")]]), new Rule(20, new FunApp("Parse",[]),[],[[new Terminal("analyser")]]), new Rule(47, new FunApp("Parse",[]),[],[[new Terminal("analyser")]]), new Rule(46, new FunApp("Parse",[]),[],[[new Terminal("analyse")]]), new Rule(45, new FunApp("Parse",[]),[],[[new Terminal("analyses")]]), new Rule(44, new FunApp("Parse",[]),[],[[new Terminal("analyse")]]), new Rule(43, new FunApp("Parse",[]),[],[[new Terminal("analysons")]]), new Rule(42, new FunApp("Parse",[]),[],[[new Terminal("analysez")]]), new Rule(41, new FunApp("Parse",[]),[],[[new Terminal("analysent")]]), new Rule(40, new FunApp("Parse",[]),[],[[new Terminal("analyse")]]), new Rule(39, new FunApp("Parse",[]),[],[[new Terminal("analyses")]]), new Rule(38, new FunApp("Parse",[]),[],[[new Terminal("analyse")]]), new Rule(37, new FunApp("Parse",[]),[],[[new Terminal("analysions")]]), new Rule(36, new FunApp("Parse",[]),[],[[new Terminal("analysiez")]]), new Rule(35, new FunApp("Parse",[]),[],[[new Terminal("analysent")]]), new Rule(34, new FunApp("Parse",[]),[],[[new Terminal("analyse")]]), new Rule(33, new FunApp("Parse",[]),[],[[new Terminal("analysons")]]), new Rule(32, new FunApp("Parse",[]),[],[[new Terminal("analysez")]]), new Rule(31, new FunApp("Parse",[]),[],[[new Terminal("analysé")]]), new Rule(30, new FunApp("Parse",[]),[],[[new Terminal("analysés")]]), new Rule(29, new FunApp("Parse",[]),[],[[new Terminal("analysée")]]), new Rule(28, new FunApp("Parse",[]),[],[[new Terminal("analysées")]]), new Rule(27, new FunApp("Parse",[]),[],[[new Terminal("analysant")]]), new Rule(23, new FunApp("Page",[]),[],[[new Terminal("page")]]), new Rule(87, new FunApp("Page",[]),[],[[new Terminal("pages")]]), new Rule(17, new FunApp("Norwegian",[]),[],[[new Terminal("norvégien")]]), new Rule(16, new FunApp("Norwegian",[]),[],[[new Terminal("norvégiens")]]), new Rule(17, new FunApp("Node",[]),[],[[new Terminal("noeud")]]), new Rule(16, new FunApp("Node",[]),[],[[new Terminal("noeuds")]]), new Rule(15, new FunApp("Next",[]),[],[[new Terminal("prochain")]]), new Rule(14, new FunApp("Next",[]),[],[[new Terminal("prochains")]]), new Rule(13, new FunApp("Next",[]),[],[[new Terminal("prochaine")]]), new Rule(12, new FunApp("Next",[]),[],[[new Terminal("prochaines")]]), new Rule(11, new FunApp("Next",[]),[],[[new Terminal("prochainement")]]), new Rule(10, new FunApp("Next",[]),[],[[new Terminal("plus"), new Terminal("prochain")]]), new Rule(9, new FunApp("Next",[]),[],[[new Terminal("plus"), new Terminal("prochains")]]), new Rule(8, new FunApp("Next",[]),[],[[new Terminal("plus"), new Terminal("prochaine")]]), new Rule(7, new FunApp("Next",[]),[],[[new Terminal("plus"), new Terminal("prochaines")]]), new Rule(6, new FunApp("Next",[]),[],[[new Terminal("plus"), new Terminal("prochainement")]]), new Rule(5, new FunApp("Next",[]),[],[[new Terminal("plus"), new Terminal("prochain")]]), new Rule(4, new FunApp("Next",[]),[],[[new Terminal("plus"), new Terminal("prochains")]]), new Rule(3, new FunApp("Next",[]),[],[[new Terminal("plus"), new Terminal("prochaine")]]), new Rule(2, new FunApp("Next",[]),[],[[new Terminal("plus"), new Terminal("prochaines")]]), new Rule(1, new FunApp("Next",[]),[],[[new Terminal("plus"), new Terminal("prochainement")]]), new Rule(23, new FunApp("Language",[]),[],[[new Terminal("langue")]]), new Rule(87, new FunApp("Language",[]),[],[[new Terminal("langues")]]), new Rule(18, new FunApp("Label",[new Arg(0)]),[89],[[new ArgProj(0, 0)]]), new Rule(89, new Arg(0),[23],[[new ArgProj(0, 0)]]), new Rule(89, new Arg(0),[17],[[new ArgProj(0, 0)]]), new Rule(17, new FunApp("Italian",[]),[],[[new Terminal("italien")]]), new Rule(16, new FunApp("Italian",[]),[],[[new Terminal("italiens")]]), new Rule(17, new FunApp("Integer_N",[]),[],[[new Terminal("entier")]]), new Rule(16, new FunApp("Integer_N",[]),[],[[new Terminal("entiers")]]), new Rule(85, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(84, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(83, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(82, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(81, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(80, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(79, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(78, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(77, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(76, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(75, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(74, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(73, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(72, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(71, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(70, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(69, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(68, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(67, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(66, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(65, new FunApp("IndefSgDet",[]),[],[[new Terminal("un")]]), new Rule(19, new FunApp("IndefSgDet",[]),[],[[new Terminal("un")]]), new Rule(64, new FunApp("IndefSgDet",[]),[],[[new Terminal("d'"), new Terminal("un")]]), new Rule(63, new FunApp("IndefSgDet",[]),[],[[new Terminal("Ã"), new Terminal("un")]]), new Rule(62, new FunApp("IndefSgDet",[]),[],[[new Terminal("un")]]), new Rule(61, new FunApp("IndefSgDet",[]),[],[[new Terminal("une")]]), new Rule(24, new FunApp("IndefSgDet",[]),[],[[new Terminal("une")]]), new Rule(60, new FunApp("IndefSgDet",[]),[],[[new Terminal("d'"), new Terminal("une")]]), new Rule(59, new FunApp("IndefSgDet",[]),[],[[new Terminal("Ã"), new Terminal("une")]]), new Rule(58, new FunApp("IndefSgDet",[]),[],[[new Terminal("une")]]), new Rule(57, new FunApp("IndefSgDet",[]),[],[[new Terminal("des")]]), new Rule(56, new FunApp("IndefSgDet",[]),[],[[new Terminal("des")]]), new Rule(55, new FunApp("IndefSgDet",[]),[],[[new Terminal("d'")]]), new Rule(55, new FunApp("IndefSgDet",[]),[],[[new Terminal("de")]]), new Rule(54, new FunApp("IndefSgDet",[]),[],[[new Terminal("Ã"), new Terminal("des")]]), new Rule(53, new FunApp("IndefSgDet",[]),[],[[new Terminal("des")]]), new Rule(52, new FunApp("IndefSgDet",[]),[],[[new Terminal("des")]]), new Rule(51, new FunApp("IndefSgDet",[]),[],[[new Terminal("des")]]), new Rule(50, new FunApp("IndefSgDet",[]),[],[[new Terminal("d'")]]), new Rule(50, new FunApp("IndefSgDet",[]),[],[[new Terminal("de")]]), new Rule(49, new FunApp("IndefSgDet",[]),[],[[new Terminal("Ã"), new Terminal("des")]]), new Rule(48, new FunApp("IndefSgDet",[]),[],[[new Terminal("des")]]), new Rule(85, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(84, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(83, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(82, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(81, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(80, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(79, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(78, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(77, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(76, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(75, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(74, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(73, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(72, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(71, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(70, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(69, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(68, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(67, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(66, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(65, new FunApp("IndefPlDet",[]),[],[[new Terminal("un")]]), new Rule(19, new FunApp("IndefPlDet",[]),[],[[new Terminal("un")]]), new Rule(64, new FunApp("IndefPlDet",[]),[],[[new Terminal("d'"), new Terminal("un")]]), new Rule(63, new FunApp("IndefPlDet",[]),[],[[new Terminal("Ã"), new Terminal("un")]]), new Rule(62, new FunApp("IndefPlDet",[]),[],[[new Terminal("un")]]), new Rule(61, new FunApp("IndefPlDet",[]),[],[[new Terminal("une")]]), new Rule(24, new FunApp("IndefPlDet",[]),[],[[new Terminal("une")]]), new Rule(60, new FunApp("IndefPlDet",[]),[],[[new Terminal("d'"), new Terminal("une")]]), new Rule(59, new FunApp("IndefPlDet",[]),[],[[new Terminal("Ã"), new Terminal("une")]]), new Rule(58, new FunApp("IndefPlDet",[]),[],[[new Terminal("une")]]), new Rule(57, new FunApp("IndefPlDet",[]),[],[[new Terminal("des")]]), new Rule(56, new FunApp("IndefPlDet",[]),[],[[new Terminal("des")]]), new Rule(55, new FunApp("IndefPlDet",[]),[],[[new Terminal("d'")]]), new Rule(55, new FunApp("IndefPlDet",[]),[],[[new Terminal("de")]]), new Rule(54, new FunApp("IndefPlDet",[]),[],[[new Terminal("Ã"), new Terminal("des")]]), new Rule(53, new FunApp("IndefPlDet",[]),[],[[new Terminal("des")]]), new Rule(52, new FunApp("IndefPlDet",[]),[],[[new Terminal("des")]]), new Rule(51, new FunApp("IndefPlDet",[]),[],[[new Terminal("des")]]), new Rule(50, new FunApp("IndefPlDet",[]),[],[[new Terminal("d'")]]), new Rule(50, new FunApp("IndefPlDet",[]),[],[[new Terminal("de")]]), new Rule(49, new FunApp("IndefPlDet",[]),[],[[new Terminal("Ã"), new Terminal("des")]]), new Rule(48, new FunApp("IndefPlDet",[]),[],[[new Terminal("des")]]), new Rule(17, new FunApp("German",[]),[],[[new Terminal("allemand")]]), new Rule(16, new FunApp("German",[]),[],[[new Terminal("allemands")]]), new Rule(17, new FunApp("French",[]),[],[[new Terminal("français")]]), new Rule(16, new FunApp("French",[]),[],[[new Terminal("français")]]), new Rule(17, new FunApp("Float_N",[]),[],[[new Terminal("réel")]]), new Rule(16, new FunApp("Float_N",[]),[],[[new Terminal("réels")]]), new Rule(17, new FunApp("Finnish",[]),[],[[new Terminal("finnois")]]), new Rule(16, new FunApp("Finnish",[]),[],[[new Terminal("finnois")]]), new Rule(18, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[12, 87],[[new Terminal("il"), new Terminal("n'"), new Terminal("y"), new Terminal("a"), new Terminal("pas"), new Terminal("des"), new ArgProj(1, 0), new ArgProj(0, 0)]]), new Rule(18, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[12, 87],[[new Terminal("il"), new Terminal("ne"), new Terminal("y"), new Terminal("a"), new Terminal("pas"), new Terminal("des"), new ArgProj(1, 0), new ArgProj(0, 0)]]), new Rule(18, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[14, 16],[[new Terminal("il"), new Terminal("n'"), new Terminal("y"), new Terminal("a"), new Terminal("pas"), new Terminal("des"), new ArgProj(1, 0), new ArgProj(0, 0)]]), new Rule(18, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[14, 16],[[new Terminal("il"), new Terminal("ne"), new Terminal("y"), new Terminal("a"), new Terminal("pas"), new Terminal("des"), new ArgProj(1, 0), new ArgProj(0, 0)]]), new Rule(18, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[88, 87],[[new Terminal("il"), new Terminal("n'"), new Terminal("y"), new Terminal("a"), new Terminal("pas"), new Terminal("des"), new ArgProj(0, 0), new ArgProj(1, 0)]]), new Rule(18, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[88, 87],[[new Terminal("il"), new Terminal("ne"), new Terminal("y"), new Terminal("a"), new Terminal("pas"), new Terminal("des"), new ArgProj(0, 0), new ArgProj(1, 0)]]), new Rule(18, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[86, 16],[[new Terminal("il"), new Terminal("n'"), new Terminal("y"), new Terminal("a"), new Terminal("pas"), new Terminal("des"), new ArgProj(0, 0), new ArgProj(1, 0)]]), new Rule(18, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[86, 16],[[new Terminal("il"), new Terminal("ne"), new Terminal("y"), new Terminal("a"), new Terminal("pas"), new Terminal("des"), new ArgProj(0, 0), new ArgProj(1, 0)]]), new Rule(20, new FunApp("Enter",[]),[],[[new Terminal("introduire")]]), new Rule(47, new FunApp("Enter",[]),[],[[new Terminal("introduire")]]), new Rule(46, new FunApp("Enter",[]),[],[[new Terminal("introduis")]]), new Rule(45, new FunApp("Enter",[]),[],[[new Terminal("introduis")]]), new Rule(44, new FunApp("Enter",[]),[],[[new Terminal("introduit")]]), new Rule(43, new FunApp("Enter",[]),[],[[new Terminal("introduisons")]]), new Rule(42, new FunApp("Enter",[]),[],[[new Terminal("introduisez")]]), new Rule(41, new FunApp("Enter",[]),[],[[new Terminal("introduisent")]]), new Rule(40, new FunApp("Enter",[]),[],[[new Terminal("introduise")]]), new Rule(39, new FunApp("Enter",[]),[],[[new Terminal("introduises")]]), new Rule(38, new FunApp("Enter",[]),[],[[new Terminal("introduise")]]), new Rule(37, new FunApp("Enter",[]),[],[[new Terminal("introduisions")]]), new Rule(36, new FunApp("Enter",[]),[],[[new Terminal("introduisiez")]]), new Rule(35, new FunApp("Enter",[]),[],[[new Terminal("introduisent")]]), new Rule(34, new FunApp("Enter",[]),[],[[new Terminal("introduis")]]), new Rule(33, new FunApp("Enter",[]),[],[[new Terminal("introduisons")]]), new Rule(32, new FunApp("Enter",[]),[],[[new Terminal("introduisez")]]), new Rule(31, new FunApp("Enter",[]),[],[[new Terminal("introduit")]]), new Rule(30, new FunApp("Enter",[]),[],[[new Terminal("introduits")]]), new Rule(29, new FunApp("Enter",[]),[],[[new Terminal("introduite")]]), new Rule(28, new FunApp("Enter",[]),[],[[new Terminal("introduites")]]), new Rule(27, new FunApp("Enter",[]),[],[[new Terminal("introduisant")]]), new Rule(17, new FunApp("English",[]),[],[[new Terminal("anglais")]]), new Rule(16, new FunApp("English",[]),[],[[new Terminal("anglais")]]), new Rule(20, new FunApp("Delete",[]),[],[[new Terminal("enlever")]]), new Rule(47, new FunApp("Delete",[]),[],[[new Terminal("enlever")]]), new Rule(46, new FunApp("Delete",[]),[],[[new Terminal("enleve")]]), new Rule(45, new FunApp("Delete",[]),[],[[new Terminal("enleves")]]), new Rule(44, new FunApp("Delete",[]),[],[[new Terminal("enleve")]]), new Rule(43, new FunApp("Delete",[]),[],[[new Terminal("enlevons")]]), new Rule(42, new FunApp("Delete",[]),[],[[new Terminal("enlevez")]]), new Rule(41, new FunApp("Delete",[]),[],[[new Terminal("enlevent")]]), new Rule(40, new FunApp("Delete",[]),[],[[new Terminal("enleve")]]), new Rule(39, new FunApp("Delete",[]),[],[[new Terminal("enleves")]]), new Rule(38, new FunApp("Delete",[]),[],[[new Terminal("enleve")]]), new Rule(37, new FunApp("Delete",[]),[],[[new Terminal("enlevions")]]), new Rule(36, new FunApp("Delete",[]),[],[[new Terminal("enleviez")]]), new Rule(35, new FunApp("Delete",[]),[],[[new Terminal("enlevent")]]), new Rule(34, new FunApp("Delete",[]),[],[[new Terminal("enleve")]]), new Rule(33, new FunApp("Delete",[]),[],[[new Terminal("enlevons")]]), new Rule(32, new FunApp("Delete",[]),[],[[new Terminal("enlevez")]]), new Rule(31, new FunApp("Delete",[]),[],[[new Terminal("enlevé")]]), new Rule(30, new FunApp("Delete",[]),[],[[new Terminal("enlevés")]]), new Rule(29, new FunApp("Delete",[]),[],[[new Terminal("enlevée")]]), new Rule(28, new FunApp("Delete",[]),[],[[new Terminal("enlevées")]]), new Rule(27, new FunApp("Delete",[]),[],[[new Terminal("enlevant")]]), new Rule(85, new FunApp("DefSgDet",[]),[],[[new Terminal("l'")]]), new Rule(85, new FunApp("DefSgDet",[]),[],[[new Terminal("le")]]), new Rule(84, new FunApp("DefSgDet",[]),[],[[new Terminal("l'")]]), new Rule(84, new FunApp("DefSgDet",[]),[],[[new Terminal("le")]]), new Rule(83, new FunApp("DefSgDet",[]),[],[[new Terminal("de"), new Terminal("l'")]]), new Rule(83, new FunApp("DefSgDet",[]),[],[[new Terminal("du")]]), new Rule(82, new FunApp("DefSgDet",[]),[],[[new Terminal("Ã"), new Terminal("l'")]]), new Rule(82, new FunApp("DefSgDet",[]),[],[[new Terminal("au")]]), new Rule(81, new FunApp("DefSgDet",[]),[],[[new Terminal("l'")]]), new Rule(81, new FunApp("DefSgDet",[]),[],[[new Terminal("le")]]), new Rule(80, new FunApp("DefSgDet",[]),[],[[new Terminal("l'")]]), new Rule(80, new FunApp("DefSgDet",[]),[],[[new Terminal("la")]]), new Rule(79, new FunApp("DefSgDet",[]),[],[[new Terminal("l'")]]), new Rule(79, new FunApp("DefSgDet",[]),[],[[new Terminal("la")]]), new Rule(78, new FunApp("DefSgDet",[]),[],[[new Terminal("d'"), new Terminal("l'")]]), new Rule(78, new FunApp("DefSgDet",[]),[],[[new Terminal("de"), new Terminal("l'")]]), new Rule(78, new FunApp("DefSgDet",[]),[],[[new Terminal("d'"), new Terminal("la")]]), new Rule(78, new FunApp("DefSgDet",[]),[],[[new Terminal("de"), new Terminal("la")]]), new Rule(77, new FunApp("DefSgDet",[]),[],[[new Terminal("Ã"), new Terminal("l'")]]), new Rule(77, new FunApp("DefSgDet",[]),[],[[new Terminal("Ã"), new Terminal("la")]]), new Rule(76, new FunApp("DefSgDet",[]),[],[[new Terminal("l'")]]), new Rule(76, new FunApp("DefSgDet",[]),[],[[new Terminal("la")]]), new Rule(75, new FunApp("DefSgDet",[]),[],[[new Terminal("les")]]), new Rule(74, new FunApp("DefSgDet",[]),[],[[new Terminal("les")]]), new Rule(73, new FunApp("DefSgDet",[]),[],[[new Terminal("des")]]), new Rule(72, new FunApp("DefSgDet",[]),[],[[new Terminal("aux")]]), new Rule(71, new FunApp("DefSgDet",[]),[],[[new Terminal("les")]]), new Rule(70, new FunApp("DefSgDet",[]),[],[[new Terminal("les")]]), new Rule(69, new FunApp("DefSgDet",[]),[],[[new Terminal("les")]]), new Rule(68, new FunApp("DefSgDet",[]),[],[[new Terminal("des")]]), new Rule(67, new FunApp("DefSgDet",[]),[],[[new Terminal("aux")]]), new Rule(66, new FunApp("DefSgDet",[]),[],[[new Terminal("les")]]), new Rule(65, new FunApp("DefSgDet",[]),[],[[new Terminal("l'")]]), new Rule(65, new FunApp("DefSgDet",[]),[],[[new Terminal("le")]]), new Rule(19, new FunApp("DefSgDet",[]),[],[[new Terminal("l'")]]), new Rule(19, new FunApp("DefSgDet",[]),[],[[new Terminal("le")]]), new Rule(64, new FunApp("DefSgDet",[]),[],[[new Terminal("de"), new Terminal("l'")]]), new Rule(64, new FunApp("DefSgDet",[]),[],[[new Terminal("du")]]), new Rule(63, new FunApp("DefSgDet",[]),[],[[new Terminal("Ã"), new Terminal("l'")]]), new Rule(63, new FunApp("DefSgDet",[]),[],[[new Terminal("au")]]), new Rule(62, new FunApp("DefSgDet",[]),[],[[new Terminal("l'")]]), new Rule(62, new FunApp("DefSgDet",[]),[],[[new Terminal("le")]]), new Rule(61, new FunApp("DefSgDet",[]),[],[[new Terminal("l'")]]), new Rule(61, new FunApp("DefSgDet",[]),[],[[new Terminal("la")]]), new Rule(24, new FunApp("DefSgDet",[]),[],[[new Terminal("l'")]]), new Rule(24, new FunApp("DefSgDet",[]),[],[[new Terminal("la")]]), new Rule(60, new FunApp("DefSgDet",[]),[],[[new Terminal("d'"), new Terminal("l'")]]), new Rule(60, new FunApp("DefSgDet",[]),[],[[new Terminal("de"), new Terminal("l'")]]), new Rule(60, new FunApp("DefSgDet",[]),[],[[new Terminal("d'"), new Terminal("la")]]), new Rule(60, new FunApp("DefSgDet",[]),[],[[new Terminal("de"), new Terminal("la")]]), new Rule(59, new FunApp("DefSgDet",[]),[],[[new Terminal("Ã"), new Terminal("l'")]]), new Rule(59, new FunApp("DefSgDet",[]),[],[[new Terminal("Ã"), new Terminal("la")]]), new Rule(58, new FunApp("DefSgDet",[]),[],[[new Terminal("l'")]]), new Rule(58, new FunApp("DefSgDet",[]),[],[[new Terminal("la")]]), new Rule(57, new FunApp("DefSgDet",[]),[],[[new Terminal("les")]]), new Rule(56, new FunApp("DefSgDet",[]),[],[[new Terminal("les")]]), new Rule(55, new FunApp("DefSgDet",[]),[],[[new Terminal("des")]]), new Rule(54, new FunApp("DefSgDet",[]),[],[[new Terminal("aux")]]), new Rule(53, new FunApp("DefSgDet",[]),[],[[new Terminal("les")]]), new Rule(52, new FunApp("DefSgDet",[]),[],[[new Terminal("les")]]), new Rule(51, new FunApp("DefSgDet",[]),[],[[new Terminal("les")]]), new Rule(50, new FunApp("DefSgDet",[]),[],[[new Terminal("des")]]), new Rule(49, new FunApp("DefSgDet",[]),[],[[new Terminal("aux")]]), new Rule(48, new FunApp("DefSgDet",[]),[],[[new Terminal("les")]]), new Rule(85, new FunApp("DefPlDet",[]),[],[[new Terminal("l'")]]), new Rule(85, new FunApp("DefPlDet",[]),[],[[new Terminal("le")]]), new Rule(84, new FunApp("DefPlDet",[]),[],[[new Terminal("l'")]]), new Rule(84, new FunApp("DefPlDet",[]),[],[[new Terminal("le")]]), new Rule(83, new FunApp("DefPlDet",[]),[],[[new Terminal("de"), new Terminal("l'")]]), new Rule(83, new FunApp("DefPlDet",[]),[],[[new Terminal("du")]]), new Rule(82, new FunApp("DefPlDet",[]),[],[[new Terminal("Ã"), new Terminal("l'")]]), new Rule(82, new FunApp("DefPlDet",[]),[],[[new Terminal("au")]]), new Rule(81, new FunApp("DefPlDet",[]),[],[[new Terminal("l'")]]), new Rule(81, new FunApp("DefPlDet",[]),[],[[new Terminal("le")]]), new Rule(80, new FunApp("DefPlDet",[]),[],[[new Terminal("l'")]]), new Rule(80, new FunApp("DefPlDet",[]),[],[[new Terminal("la")]]), new Rule(79, new FunApp("DefPlDet",[]),[],[[new Terminal("l'")]]), new Rule(79, new FunApp("DefPlDet",[]),[],[[new Terminal("la")]]), new Rule(78, new FunApp("DefPlDet",[]),[],[[new Terminal("d'"), new Terminal("l'")]]), new Rule(78, new FunApp("DefPlDet",[]),[],[[new Terminal("de"), new Terminal("l'")]]), new Rule(78, new FunApp("DefPlDet",[]),[],[[new Terminal("d'"), new Terminal("la")]]), new Rule(78, new FunApp("DefPlDet",[]),[],[[new Terminal("de"), new Terminal("la")]]), new Rule(77, new FunApp("DefPlDet",[]),[],[[new Terminal("Ã"), new Terminal("l'")]]), new Rule(77, new FunApp("DefPlDet",[]),[],[[new Terminal("Ã"), new Terminal("la")]]), new Rule(76, new FunApp("DefPlDet",[]),[],[[new Terminal("l'")]]), new Rule(76, new FunApp("DefPlDet",[]),[],[[new Terminal("la")]]), new Rule(75, new FunApp("DefPlDet",[]),[],[[new Terminal("les")]]), new Rule(74, new FunApp("DefPlDet",[]),[],[[new Terminal("les")]]), new Rule(73, new FunApp("DefPlDet",[]),[],[[new Terminal("des")]]), new Rule(72, new FunApp("DefPlDet",[]),[],[[new Terminal("aux")]]), new Rule(71, new FunApp("DefPlDet",[]),[],[[new Terminal("les")]]), new Rule(70, new FunApp("DefPlDet",[]),[],[[new Terminal("les")]]), new Rule(69, new FunApp("DefPlDet",[]),[],[[new Terminal("les")]]), new Rule(68, new FunApp("DefPlDet",[]),[],[[new Terminal("des")]]), new Rule(67, new FunApp("DefPlDet",[]),[],[[new Terminal("aux")]]), new Rule(66, new FunApp("DefPlDet",[]),[],[[new Terminal("les")]]), new Rule(65, new FunApp("DefPlDet",[]),[],[[new Terminal("l'")]]), new Rule(65, new FunApp("DefPlDet",[]),[],[[new Terminal("le")]]), new Rule(19, new FunApp("DefPlDet",[]),[],[[new Terminal("l'")]]), new Rule(19, new FunApp("DefPlDet",[]),[],[[new Terminal("le")]]), new Rule(64, new FunApp("DefPlDet",[]),[],[[new Terminal("de"), new Terminal("l'")]]), new Rule(64, new FunApp("DefPlDet",[]),[],[[new Terminal("du")]]), new Rule(63, new FunApp("DefPlDet",[]),[],[[new Terminal("Ã"), new Terminal("l'")]]), new Rule(63, new FunApp("DefPlDet",[]),[],[[new Terminal("au")]]), new Rule(62, new FunApp("DefPlDet",[]),[],[[new Terminal("l'")]]), new Rule(62, new FunApp("DefPlDet",[]),[],[[new Terminal("le")]]), new Rule(61, new FunApp("DefPlDet",[]),[],[[new Terminal("l'")]]), new Rule(61, new FunApp("DefPlDet",[]),[],[[new Terminal("la")]]), new Rule(24, new FunApp("DefPlDet",[]),[],[[new Terminal("l'")]]), new Rule(24, new FunApp("DefPlDet",[]),[],[[new Terminal("la")]]), new Rule(60, new FunApp("DefPlDet",[]),[],[[new Terminal("d'"), new Terminal("l'")]]), new Rule(60, new FunApp("DefPlDet",[]),[],[[new Terminal("de"), new Terminal("l'")]]), new Rule(60, new FunApp("DefPlDet",[]),[],[[new Terminal("d'"), new Terminal("la")]]), new Rule(60, new FunApp("DefPlDet",[]),[],[[new Terminal("de"), new Terminal("la")]]), new Rule(59, new FunApp("DefPlDet",[]),[],[[new Terminal("Ã"), new Terminal("l'")]]), new Rule(59, new FunApp("DefPlDet",[]),[],[[new Terminal("Ã"), new Terminal("la")]]), new Rule(58, new FunApp("DefPlDet",[]),[],[[new Terminal("l'")]]), new Rule(58, new FunApp("DefPlDet",[]),[],[[new Terminal("la")]]), new Rule(57, new FunApp("DefPlDet",[]),[],[[new Terminal("les")]]), new Rule(56, new FunApp("DefPlDet",[]),[],[[new Terminal("les")]]), new Rule(55, new FunApp("DefPlDet",[]),[],[[new Terminal("des")]]), new Rule(54, new FunApp("DefPlDet",[]),[],[[new Terminal("aux")]]), new Rule(53, new FunApp("DefPlDet",[]),[],[[new Terminal("les")]]), new Rule(52, new FunApp("DefPlDet",[]),[],[[new Terminal("les")]]), new Rule(51, new FunApp("DefPlDet",[]),[],[[new Terminal("les")]]), new Rule(50, new FunApp("DefPlDet",[]),[],[[new Terminal("des")]]), new Rule(49, new FunApp("DefPlDet",[]),[],[[new Terminal("aux")]]), new Rule(48, new FunApp("DefPlDet",[]),[],[[new Terminal("les")]]), new Rule(17, new FunApp("Danish",[]),[],[[new Terminal("danois")]]), new Rule(16, new FunApp("Danish",[]),[],[[new Terminal("danois")]]), new Rule(20, new FunApp("Cut",[]),[],[[new Terminal("couper")]]), new Rule(47, new FunApp("Cut",[]),[],[[new Terminal("couper")]]), new Rule(46, new FunApp("Cut",[]),[],[[new Terminal("coupe")]]), new Rule(45, new FunApp("Cut",[]),[],[[new Terminal("coupes")]]), new Rule(44, new FunApp("Cut",[]),[],[[new Terminal("coupe")]]), new Rule(43, new FunApp("Cut",[]),[],[[new Terminal("coupons")]]), new Rule(42, new FunApp("Cut",[]),[],[[new Terminal("coupez")]]), new Rule(41, new FunApp("Cut",[]),[],[[new Terminal("coupent")]]), new Rule(40, new FunApp("Cut",[]),[],[[new Terminal("coupe")]]), new Rule(39, new FunApp("Cut",[]),[],[[new Terminal("coupes")]]), new Rule(38, new FunApp("Cut",[]),[],[[new Terminal("coupe")]]), new Rule(37, new FunApp("Cut",[]),[],[[new Terminal("coupions")]]), new Rule(36, new FunApp("Cut",[]),[],[[new Terminal("coupiez")]]), new Rule(35, new FunApp("Cut",[]),[],[[new Terminal("coupent")]]), new Rule(34, new FunApp("Cut",[]),[],[[new Terminal("coupe")]]), new Rule(33, new FunApp("Cut",[]),[],[[new Terminal("coupons")]]), new Rule(32, new FunApp("Cut",[]),[],[[new Terminal("coupez")]]), new Rule(31, new FunApp("Cut",[]),[],[[new Terminal("coupé")]]), new Rule(30, new FunApp("Cut",[]),[],[[new Terminal("coupés")]]), new Rule(29, new FunApp("Cut",[]),[],[[new Terminal("coupée")]]), new Rule(28, new FunApp("Cut",[]),[],[[new Terminal("coupées")]]), new Rule(27, new FunApp("Cut",[]),[],[[new Terminal("coupant")]]), new Rule(20, new FunApp("Copy",[]),[],[[new Terminal("copier")]]), new Rule(47, new FunApp("Copy",[]),[],[[new Terminal("copier")]]), new Rule(46, new FunApp("Copy",[]),[],[[new Terminal("copie")]]), new Rule(45, new FunApp("Copy",[]),[],[[new Terminal("copies")]]), new Rule(44, new FunApp("Copy",[]),[],[[new Terminal("copie")]]), new Rule(43, new FunApp("Copy",[]),[],[[new Terminal("copions")]]), new Rule(42, new FunApp("Copy",[]),[],[[new Terminal("copiez")]]), new Rule(41, new FunApp("Copy",[]),[],[[new Terminal("copient")]]), new Rule(40, new FunApp("Copy",[]),[],[[new Terminal("copie")]]), new Rule(39, new FunApp("Copy",[]),[],[[new Terminal("copies")]]), new Rule(38, new FunApp("Copy",[]),[],[[new Terminal("copie")]]), new Rule(37, new FunApp("Copy",[]),[],[[new Terminal("copiions")]]), new Rule(36, new FunApp("Copy",[]),[],[[new Terminal("copiiez")]]), new Rule(35, new FunApp("Copy",[]),[],[[new Terminal("copient")]]), new Rule(34, new FunApp("Copy",[]),[],[[new Terminal("copie")]]), new Rule(33, new FunApp("Copy",[]),[],[[new Terminal("copions")]]), new Rule(32, new FunApp("Copy",[]),[],[[new Terminal("copiez")]]), new Rule(31, new FunApp("Copy",[]),[],[[new Terminal("copié")]]), new Rule(30, new FunApp("Copy",[]),[],[[new Terminal("copiés")]]), new Rule(29, new FunApp("Copy",[]),[],[[new Terminal("copiée")]]), new Rule(28, new FunApp("Copy",[]),[],[[new Terminal("copiées")]]), new Rule(27, new FunApp("Copy",[]),[],[[new Terminal("copiant")]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[22, 24, 13, 23],[[new Terminal("s'"), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(3, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[22, 24, 13, 23],[[new Terminal("se"), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(3, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[21, 24, 13, 23],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(3, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[20, 24, 13, 23],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(3, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[22, 19, 15, 17],[[new Terminal("s'"), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(3, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[22, 19, 15, 17],[[new Terminal("se"), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(3, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[21, 19, 15, 17],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(3, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[20, 19, 15, 17],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(3, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[22, 24, 26, 23],[[new Terminal("s'"), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[22, 24, 26, 23],[[new Terminal("se"), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[21, 24, 26, 23],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[20, 24, 26, 23],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[22, 19, 25, 17],[[new Terminal("s'"), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[22, 19, 25, 17],[[new Terminal("se"), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[21, 19, 25, 17],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[20, 19, 25, 17],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(18, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[22, 24, 23],[[new Terminal("s'"), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[22, 24, 23],[[new Terminal("se"), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[21, 24, 23],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[20, 24, 23],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[22, 19, 17],[[new Terminal("s'"), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[22, 19, 17],[[new Terminal("se"), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[21, 19, 17],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[20, 19, 17],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(17, new FunApp("Bulgarian",[]),[],[[new Terminal("bulgarien")]]), new Rule(16, new FunApp("Bulgarian",[]),[],[[new Terminal("bulgariens")]]), new Rule(15, new FunApp("Available",[]),[],[[new Terminal("disponible")]]), new Rule(14, new FunApp("Available",[]),[],[[new Terminal("disponibles")]]), new Rule(13, new FunApp("Available",[]),[],[[new Terminal("disponible")]]), new Rule(12, new FunApp("Available",[]),[],[[new Terminal("disponibles")]]), new Rule(11, new FunApp("Available",[]),[],[[new Terminal("disponiblement")]]), new Rule(10, new FunApp("Available",[]),[],[[new Terminal("plus"), new Terminal("disponible")]]), new Rule(9, new FunApp("Available",[]),[],[[new Terminal("plus"), new Terminal("disponibles")]]), new Rule(8, new FunApp("Available",[]),[],[[new Terminal("plus"), new Terminal("disponible")]]), new Rule(7, new FunApp("Available",[]),[],[[new Terminal("plus"), new Terminal("disponibles")]]), new Rule(6, new FunApp("Available",[]),[],[[new Terminal("plus"), new Terminal("disponiblement")]]), new Rule(5, new FunApp("Available",[]),[],[[new Terminal("plus"), new Terminal("disponible")]]), new Rule(4, new FunApp("Available",[]),[],[[new Terminal("plus"), new Terminal("disponibles")]]), new Rule(3, new FunApp("Available",[]),[],[[new Terminal("plus"), new Terminal("disponible")]]), new Rule(2, new FunApp("Available",[]),[],[[new Terminal("plus"), new Terminal("disponibles")]]), new Rule(1, new FunApp("Available",[]),[],[[new Terminal("plus"), new Terminal("disponiblement")]])],{Adjective:[25, 15, 10, 5, 86, 14, 9, 4, 26, 13, 8, 3, 88, 12, 7, 2, 11, 6, 1], Determiner:[85, 65, 75, 57, 80, 61, 70, 52, 84, 19, 74, 56, 79, 24, 69, 51, 83, 64, 73, 55, 78, 60, 68, 50, 82, 63, 72, 54, 77, 59, 67, 49, 81, 62, 71, 53, 76, 58, 66, 48], Float:[-3], Int:[-2], Noun:[89, 17, 23, 16, 87], Sentence:[18], String:[-1], Verb:[20, 21, 22, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27], _Var:[-4]})), EditorSpa: new GFConcrete({coding: "utf8"},{Available: function(cs){return new Arr(new Arr(new Suffix("disponible", Editor.concretes["EditorSpa"].rule("_0", cs)), Editor.concretes["EditorSpa"].rule("_5", cs), Editor.concretes["EditorSpa"].rule("_5", cs)), new Int(1));}, Bulgarian: function(cs){return new Arr(new Suffix("Búlgaro", Editor.concretes["EditorSpa"].rule("_8", cs)), new Int(0));}, Command: function(cs){return new Arr(new Seq(Editor.concretes["EditorSpa"].rule("_12", cs), Editor.concretes["EditorSpa"].rule("_38", cs), Editor.concretes["EditorSpa"].rule("_40", cs), Editor.concretes["EditorSpa"].rule("_42", cs), Editor.concretes["EditorSpa"].rule("_55", cs)));}, CommandAdj: function(cs){return new Arr(new Seq(Editor.concretes["EditorSpa"].rule("_12", cs), Editor.concretes["EditorSpa"].rule("_14", cs).sel(Editor.concretes["EditorSpa"].rule("_24", cs).sel(Editor.concretes["EditorSpa"].rule("_63", cs))), Editor.concretes["EditorSpa"].rule("_40", cs), Editor.concretes["EditorSpa"].rule("_41", cs).sel(Editor.concretes["EditorSpa"].rule("_63", cs)),(new Arr(new Arr(Editor.concretes["EditorSpa"].rule("_13", cs), Editor.concretes["EditorSpa"].rule("_78", cs)), new Arr(Editor.concretes["EditorSpa"].rule("_78", cs), Editor.concretes["EditorSpa"].rule("_78", cs)))).sel(Editor.concretes["EditorSpa"].rule("_19", cs)).sel(Editor.concretes["EditorSpa"].rule("_21", cs))));}, Copy: function(cs){return new Arr(new Suffix("Cop", new Arr(new Str("iar"), new Str("iar"), new Str("ío"), new Str("ías"), new Str("ía"), new Str("iamos"), new Str("iáis"), new Str("ían"), new Str("íe"), new Str("íes"), new Str("íe"), new Str("iemos"), new Str("iéis"), new Str("íen"), new Str("ía"), new Str("iemos"), new Str("iad"), new Str("iado"), new Str("iados"), new Str("iada"), new Str("iadas"), new Str("iando"))), new Int(0));}, Cut: function(cs){return new Arr(new Suffix("Cort", Editor.concretes["EditorSpa"].rule("_89", cs)), new Int(0));}, Danish: function(cs){return new Arr(new Suffix("Danés", Editor.concretes["EditorSpa"].rule("_92", cs)), new Int(0));}, DefPlDet: function(cs){return Editor.concretes["EditorSpa"].rule("_109", cs);}, DefSgDet: function(cs){return Editor.concretes["EditorSpa"].rule("_109", cs);}, Delete: function(cs){return new Arr(new Suffix("Borr", Editor.concretes["EditorSpa"].rule("_89", cs)), new Int(0));}, English: function(cs){return new Arr(new Suffix("Inglés", Editor.concretes["EditorSpa"].rule("_92", cs)), new Int(0));}, Enter: function(cs){return new Arr(new Suffix("introdu", new Arr(new Str("cir"), new Str("cir"), new Str("zco"), new Str("ces"), new Str("ce"), new Str("cimos"), new Str("cís"), new Str("cen"), new Str("zca"), new Str("zcas"), new Str("zca"), new Str("zcamos"), new Str("zcáis"), new Str("zcan"), new Str("ce"), new Str("zcamos"), new Str("cid"), new Str("cido"), new Str("cidos"), new Str("cida"), new Str("cidas"), new Str("ciendo"))), new Int(0));}, ErrorMessage: function(cs){return new Arr(new Seq(new Str("no"),(new Arr(Editor.concretes["EditorSpa"].rule("_119", cs), Editor.concretes["EditorSpa"].rule("_119", cs))).sel(Editor.concretes["EditorSpa"].rule("_121", cs).sel(new Int(0))).sel(Editor.concretes["EditorSpa"].rule("_121", cs).sel(new Int(1))).sel(Editor.concretes["EditorSpa"].rule("_121", cs).sel(new Int(2))),(new Arr(Editor.concretes["EditorSpa"].rule("_128", cs), Editor.concretes["EditorSpa"].rule("_128", cs))).sel(Editor.concretes["EditorSpa"].rule("_130", cs).sel(new Int(0))).sel(Editor.concretes["EditorSpa"].rule("_130", cs).sel(new Int(1))),(new Arr(new Str("un"), new Str("una"))).sel(Editor.concretes["EditorSpa"].rule("_136", cs)),(new Arr(new Seq(Editor.concretes["EditorSpa"].rule("_139", cs), Editor.concretes["EditorSpa"].rule("_140", cs)), new Seq(Editor.concretes["EditorSpa"].rule("_140", cs), Editor.concretes["EditorSpa"].rule("_139", cs)))).sel(Editor.concretes["EditorSpa"].rule("_29", cs))));}, Finnish: function(cs){return new Arr(new Suffix("Finlandés", Editor.concretes["EditorSpa"].rule("_92", cs)), new Int(0));}, Float_N: function(cs){return new Arr(new Arr(new Seq(new Str("número"), new Str("real")), new Seq(new Str("números"), new Str("real"))), new Int(0));}, French: function(cs){return new Arr(new Suffix("Francés", Editor.concretes["EditorSpa"].rule("_92", cs)), new Int(0));}, German: function(cs){return new Arr(new Suffix("Alemán", Editor.concretes["EditorSpa"].rule("_92", cs)), new Int(0));}, IndefPlDet: function(cs){return Editor.concretes["EditorSpa"].rule("_176", cs);}, IndefSgDet: function(cs){return Editor.concretes["EditorSpa"].rule("_176", cs);}, Integer_N: function(cs){return new Arr(new Arr(new Seq(new Str("número"), new Str("entero")), new Seq(new Str("números"), new Str("entero"))), new Int(0));}, Italian: function(cs){return new Arr(new Suffix("Italiano", Editor.concretes["EditorSpa"].rule("_8", cs)), new Int(0));}, Label: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_12", cs));}, Language: function(cs){return new Arr(new Suffix("lenguaje", Editor.concretes["EditorSpa"].rule("_8", cs)), new Int(0));}, Next: function(cs){return new Arr(new Arr(new Suffix("siguiente", Editor.concretes["EditorSpa"].rule("_0", cs)), Editor.concretes["EditorSpa"].rule("_190", cs), Editor.concretes["EditorSpa"].rule("_190", cs)), new Int(1));}, Node: function(cs){return new Arr(new Suffix("nodo", Editor.concretes["EditorSpa"].rule("_8", cs)), new Int(0));}, Norwegian: function(cs){return new Arr(new Suffix("Noruego", Editor.concretes["EditorSpa"].rule("_8", cs)), new Int(0));}, Page: function(cs){return new Arr(new Suffix("página", Editor.concretes["EditorSpa"].rule("_8", cs)), new Int(1));}, Parse: function(cs){return new Arr(new Arr(new Str("Analizar"), new Str("Analizar"), new Str("Analizo"), new Str("Analizas"), new Str("Analiza"), new Str("Analizamos"), new Str("Analizáis"), new Str("Analizan"), new Str("Analice"), new Str("Analices"), new Str("Analice"), new Str("Analicemos"), new Str("Analicéis"), new Str("Analicen"), new Str("Analiza"), new Str("Analicemos"), new Str("Analizad"), new Str("sintácticamente"), new Str("sintácticamentos"), new Str("sintácticamenta"), new Str("sintácticamentas"), new Str("Analizando")), new Int(0));}, Paste: function(cs){return new Arr(new Suffix("Peg", new Arr(new Str("ar"), new Str("ar"), new Str("o"), new Str("as"), new Str("a"), new Str("amos"), new Str("áis"), new Str("an"), new Str("ue"), new Str("ues"), new Str("ue"), new Str("uemos"), new Str("uéis"), new Str("uen"), new Str("a"), new Str("uemos"), new Str("ad"), new Str("ado"), new Str("ados"), new Str("ada"), new Str("adas"), new Str("ando"))), new Int(0));}, Previous: function(cs){return new Arr(new Arr(new Suffix("anterior", new Arr(new Str(""), new Str("es"), new Str(""), new Str("es"), new Str("mente"))), Editor.concretes["EditorSpa"].rule("_209", cs), Editor.concretes["EditorSpa"].rule("_209", cs)), new Int(1));}, RandomlyCommand: function(cs){return new Arr(new Seq(Editor.concretes["EditorSpa"].rule("_12", cs), Editor.concretes["EditorSpa"].rule("_38", cs), Editor.concretes["EditorSpa"].rule("_40", cs), Editor.concretes["EditorSpa"].rule("_42", cs), Editor.concretes["EditorSpa"].rule("_55", cs), new Str("aleatoriamente")));}, Redo: function(cs){return new Arr(new Suffix("reh", Editor.concretes["EditorSpa"].rule("_214", cs)), new Int(0));}, Refine: function(cs){return new Arr(new Suffix("Refin", Editor.concretes["EditorSpa"].rule("_89", cs)), new Int(0));}, Refinement: function(cs){return new Arr(new Suffix("refinamiento", Editor.concretes["EditorSpa"].rule("_8", cs)), new Int(0));}, Replace: function(cs){return new Arr(new Suffix("Reempla", new Arr(new Str("zar"), new Str("zar"), new Str("zo"), new Str("zas"), new Str("za"), new Str("zamos"), new Str("záis"), new Str("zan"), new Str("ce"), new Str("ces"), new Str("ce"), new Str("cemos"), new Str("céis"), new Str("cen"), new Str("za"), new Str("cemos"), new Str("zad"), new Str("zado"), new Str("zados"), new Str("zada"), new Str("zadas"), new Str("zando"))), new Int(0));}, Russian: function(cs){return new Arr(new Suffix("Ruso", Editor.concretes["EditorSpa"].rule("_8", cs)), new Int(0));}, Select: function(cs){return new Arr(new Suffix("Seleccion", Editor.concretes["EditorSpa"].rule("_89", cs)), new Int(0));}, Show: function(cs){return new Arr(new Suffix("Mostr", Editor.concretes["EditorSpa"].rule("_89", cs)), new Int(0));}, SingleWordCommand: function(cs){return new Arr(new Seq(Editor.concretes["EditorSpa"].rule("_12", cs), Editor.concretes["EditorSpa"].rule("_14", cs).sel((new Arr(new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(1))).sel(Editor.concretes["EditorSpa"].rule("_31", cs))), Editor.concretes["EditorSpa"].rule("_41", cs).sel(Editor.concretes["EditorSpa"].rule("_31", cs))));}, Spanish: function(cs){return new Arr(new Suffix("Español", Editor.concretes["EditorSpa"].rule("_92", cs)), new Int(0));}, String_N: function(cs){return new Arr(new Arr(new Seq(new Str("cadena"), new Str("de"), new Str("caracteres")), new Seq(new Str("cadenas"), new Str("de"), new Str("caracteres"))), new Int(1));}, Swedish: function(cs){return new Arr(new Suffix("Sueco", Editor.concretes["EditorSpa"].rule("_8", cs)), new Int(0));}, Tree: function(cs){return new Arr(new Suffix("árbol", Editor.concretes["EditorSpa"].rule("_92", cs)), new Int(0));}, Undo: function(cs){return new Arr(new Suffix("desh", Editor.concretes["EditorSpa"].rule("_214", cs)), new Int(0));}, Wrap: function(cs){return new Arr(new Suffix("env", new Arr(new Str("olver"), new Str("olver"), new Str("uelvo"), new Str("uelves"), new Str("uelve"), new Str("olvemos"), new Str("olvéis"), new Str("uelven"), new Str("uelva"), new Str("uelvas"), new Str("uelva"), new Str("olvamos"), new Str("olváis"), new Str("uelvan"), new Str("uelve"), new Str("olvamos"), new Str("olved"), new Str("olvido"), new Str("olvidos"), new Str("olvida"), new Str("olvidas"), new Str("olviendo"))), new Int(0));}, Wrapper: function(cs){return new Arr(new Suffix("envoltura", Editor.concretes["EditorSpa"].rule("_8", cs)), new Int(1));}, _0: function(cs){return new Arr(new Str(""), new Str("s"), new Str(""), new Str("s"), new Str("mente"));}, _100: function(cs){return new Seq(new Str("de"), new Str("los"));}, _101: function(cs){return new Seq(new Str("a"), new Str("los"));}, _102: function(cs){return new Arr(new Str("los"), new Str("los"), Editor.concretes["EditorSpa"].rule("_100", cs), Editor.concretes["EditorSpa"].rule("_101", cs));}, _103: function(cs){return new Seq(new Str("de"), new Str("las"));}, _104: function(cs){return new Seq(new Str("a"), new Str("las"));}, _105: function(cs){return new Arr(new Str("las"), new Str("las"), Editor.concretes["EditorSpa"].rule("_103", cs), Editor.concretes["EditorSpa"].rule("_104", cs));}, _106: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_102", cs), Editor.concretes["EditorSpa"].rule("_105", cs));}, _107: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_99", cs), Editor.concretes["EditorSpa"].rule("_106", cs));}, _108: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_107", cs), Editor.concretes["EditorSpa"].rule("_107", cs));}, _109: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_108", cs));}, _11: function(cs){return cs[0].sel(new Int(0));}, _117: function(cs){return new Arr(new Str("he"), new Str("has"), new Str("hay"));}, _118: function(cs){return new Arr(new Str("hemos"), new Str("habéis"), new Str("han"));}, _119: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_117", cs), Editor.concretes["EditorSpa"].rule("_118", cs));}, _12: function(cs){return Editor.concretes["EditorSpa"].rule("_11", cs).sel(new Int(0));}, _121: function(cs){return new Arr(new Int(0), new Int(0), new Int(2));}, _128: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_13", cs), Editor.concretes["EditorSpa"].rule("_13", cs));}, _13: function(cs){return new Seq();}, _130: function(cs){return new Arr(new Int(0), new Int(0));}, _136: function(cs){return cs[1].sel(new Int(1));}, _138: function(cs){return Editor.concretes["EditorSpa"].rule("_69", cs).sel(Editor.concretes["EditorSpa"].rule("_136", cs));}, _139: function(cs){return Editor.concretes["EditorSpa"].rule("_12", cs).sel(Editor.concretes["EditorSpa"].rule("_138", cs));}, _14: function(cs){return new Arr(new Str("&+"), Editor.concretes["EditorSpa"].rule("_13", cs));}, _140: function(cs){return Editor.concretes["EditorSpa"].rule("_43", cs).sel(new Int(0));}, _15: function(cs){return new Arr(new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(1), new Int(1));}, _157: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_13", cs), Editor.concretes["EditorSpa"].rule("_13", cs), Editor.concretes["EditorSpa"].rule("_13", cs), Editor.concretes["EditorSpa"].rule("_13", cs));}, _158: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_157", cs), Editor.concretes["EditorSpa"].rule("_157", cs));}, _159: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_158", cs), Editor.concretes["EditorSpa"].rule("_158", cs));}, _16: function(cs){return new Arr(new Int(13), new Int(13));}, _160: function(cs){return new Seq(new Str("de"), new Str("un"));}, _161: function(cs){return new Seq(new Str("a"), new Str("un"));}, _162: function(cs){return new Arr(new Str("un"), new Str("un"), Editor.concretes["EditorSpa"].rule("_160", cs), Editor.concretes["EditorSpa"].rule("_161", cs));}, _163: function(cs){return new Seq(new Str("de"), new Str("una"));}, _164: function(cs){return new Seq(new Str("a"), new Str("una"));}, _165: function(cs){return new Arr(new Str("una"), new Str("una"), Editor.concretes["EditorSpa"].rule("_163", cs), Editor.concretes["EditorSpa"].rule("_164", cs));}, _166: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_162", cs), Editor.concretes["EditorSpa"].rule("_165", cs));}, _167: function(cs){return new Seq(new Str("de"), new Str("unos"));}, _168: function(cs){return new Seq(new Str("a"), new Str("unos"));}, _169: function(cs){return new Arr(new Str("unos"), new Str("unos"), Editor.concretes["EditorSpa"].rule("_167", cs), Editor.concretes["EditorSpa"].rule("_168", cs));}, _17: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_16", cs), Editor.concretes["EditorSpa"].rule("_16", cs));}, _170: function(cs){return new Seq(new Str("de"), new Str("unas"));}, _171: function(cs){return new Seq(new Str("a"), new Str("unas"));}, _172: function(cs){return new Arr(new Str("unas"), new Str("unas"), Editor.concretes["EditorSpa"].rule("_170", cs), Editor.concretes["EditorSpa"].rule("_171", cs));}, _173: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_169", cs), Editor.concretes["EditorSpa"].rule("_172", cs));}, _174: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_166", cs), Editor.concretes["EditorSpa"].rule("_173", cs));}, _175: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_159", cs), Editor.concretes["EditorSpa"].rule("_174", cs));}, _176: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_175", cs));}, _18: function(cs){return new Arr(new Int(1), new Int(0));}, _187: function(cs){return new Seq(new Str("más"), new Str("siguiente"));}, _188: function(cs){return new Seq(new Str("más"), new Str("siguientes"));}, _189: function(cs){return new Seq(new Str("más"), new Str("siguientemente"));}, _19: function(cs){return Editor.concretes["EditorSpa"].rule("_18", cs).sel(new Int(0));}, _190: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_187", cs), Editor.concretes["EditorSpa"].rule("_188", cs), Editor.concretes["EditorSpa"].rule("_187", cs), Editor.concretes["EditorSpa"].rule("_188", cs), Editor.concretes["EditorSpa"].rule("_189", cs));}, _2: function(cs){return new Seq(new Str("más"), new Str("disponible"));}, _20: function(cs){return Editor.concretes["EditorSpa"].rule("_17", cs).sel(Editor.concretes["EditorSpa"].rule("_19", cs));}, _206: function(cs){return new Seq(new Str("más"), new Str("anterior"));}, _207: function(cs){return new Seq(new Str("más"), new Str("anteriores"));}, _208: function(cs){return new Seq(new Str("más"), new Str("anteriormente"));}, _209: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_206", cs), Editor.concretes["EditorSpa"].rule("_207", cs), Editor.concretes["EditorSpa"].rule("_206", cs), Editor.concretes["EditorSpa"].rule("_207", cs), Editor.concretes["EditorSpa"].rule("_208", cs));}, _21: function(cs){return Editor.concretes["EditorSpa"].rule("_18", cs).sel(new Int(1));}, _214: function(cs){return new Arr(new Str("acer"), new Str("acer"), new Str("ago"), new Str("aces"), new Str("ace"), new Str("acemos"), new Str("acéis"), new Str("acen"), new Str("aga"), new Str("agas"), new Str("aga"), new Str("agamos"), new Str("agáis"), new Str("agan"), new Str("az"), new Str("agamos"), new Str("aced"), new Str("echo"), new Str("echos"), new Str("echa"), new Str("echas"), new Str("aciendo"));}, _22: function(cs){return Editor.concretes["EditorSpa"].rule("_20", cs).sel(Editor.concretes["EditorSpa"].rule("_21", cs));}, _23: function(cs){return Editor.concretes["EditorSpa"].rule("_15", cs).sel(Editor.concretes["EditorSpa"].rule("_22", cs));}, _24: function(cs){return new Arr(new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), new Int(0), Editor.concretes["EditorSpa"].rule("_23", cs));}, _25: function(cs){return new Arr(new Int(2), new Int(8));}, _253: function(cs){return new Arr(cs[0], cs[0], cs[0], cs[0], cs[0]);}, _256: function(cs){return new Arr(cs[0], cs[0], cs[0], cs[0]);}, _257: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_256", cs), Editor.concretes["EditorSpa"].rule("_256", cs));}, _258: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_257", cs), Editor.concretes["EditorSpa"].rule("_257", cs));}, _26: function(cs){return cs[2].sel(new Int(1));}, _27: function(cs){return Editor.concretes["EditorSpa"].rule("_25", cs).sel(Editor.concretes["EditorSpa"].rule("_26", cs));}, _28: function(cs){return new Arr(new Int(12), new Int(13));}, _29: function(cs){return cs[0].sel(new Int(1));}, _3: function(cs){return new Seq(new Str("más"), new Str("disponibles"));}, _30: function(cs){return Editor.concretes["EditorSpa"].rule("_18", cs).sel(Editor.concretes["EditorSpa"].rule("_29", cs));}, _31: function(cs){return Editor.concretes["EditorSpa"].rule("_28", cs).sel(Editor.concretes["EditorSpa"].rule("_30", cs));}, _32: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_27", cs), Editor.concretes["EditorSpa"].rule("_31", cs));}, _33: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_31", cs), Editor.concretes["EditorSpa"].rule("_31", cs));}, _34: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_32", cs), Editor.concretes["EditorSpa"].rule("_33", cs));}, _35: function(cs){return Editor.concretes["EditorSpa"].rule("_34", cs).sel(Editor.concretes["EditorSpa"].rule("_19", cs));}, _36: function(cs){return Editor.concretes["EditorSpa"].rule("_35", cs).sel(Editor.concretes["EditorSpa"].rule("_21", cs));}, _37: function(cs){return Editor.concretes["EditorSpa"].rule("_24", cs).sel(Editor.concretes["EditorSpa"].rule("_36", cs));}, _38: function(cs){return Editor.concretes["EditorSpa"].rule("_14", cs).sel(Editor.concretes["EditorSpa"].rule("_37", cs));}, _39: function(cs){return new Arr(new Str("me"), new Str("te"), new Str("le"), new Str("nos"), new Str("vos"), new Str("les"), new Str("me"), new Str("te"), new Str("le"), new Str("nos"), new Str("vos"), new Str("les"), Editor.concretes["EditorSpa"].rule("_13", cs), Editor.concretes["EditorSpa"].rule("_13", cs));}, _4: function(cs){return new Seq(new Str("más"), new Str("disponiblemente"));}, _40: function(cs){return Editor.concretes["EditorSpa"].rule("_39", cs).sel(Editor.concretes["EditorSpa"].rule("_22", cs));}, _41: function(cs){return new Arr(new Str("me"), new Str("te"), new Str("lo"), new Str("nos"), new Str("vos"), new Str("los"), new Str("me"), new Str("te"), new Str("la"), new Str("nos"), new Str("vos"), new Str("las"), new Str("se"), Editor.concretes["EditorSpa"].rule("_13", cs));}, _42: function(cs){return Editor.concretes["EditorSpa"].rule("_41", cs).sel(Editor.concretes["EditorSpa"].rule("_36", cs));}, _43: function(cs){return cs[1].sel(new Int(0));}, _44: function(cs){return Editor.concretes["EditorSpa"].rule("_43", cs).sel(new Int(1));}, _45: function(cs){return Editor.concretes["EditorSpa"].rule("_44", cs).sel(new Int(0));}, _46: function(cs){return Editor.concretes["EditorSpa"].rule("_45", cs).sel(Editor.concretes["EditorSpa"].rule("_26", cs));}, _47: function(cs){return Editor.concretes["EditorSpa"].rule("_46", cs).sel(new Int(1));}, _48: function(cs){return cs[2].sel(new Int(0));}, _49: function(cs){return Editor.concretes["EditorSpa"].rule("_48", cs).sel(new Int(0));}, _5: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_2", cs), Editor.concretes["EditorSpa"].rule("_3", cs), Editor.concretes["EditorSpa"].rule("_2", cs), Editor.concretes["EditorSpa"].rule("_3", cs), Editor.concretes["EditorSpa"].rule("_4", cs));}, _50: function(cs){return new Seq(Editor.concretes["EditorSpa"].rule("_47", cs), Editor.concretes["EditorSpa"].rule("_49", cs));}, _51: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_13", cs), Editor.concretes["EditorSpa"].rule("_50", cs));}, _52: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_50", cs), Editor.concretes["EditorSpa"].rule("_50", cs));}, _53: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_51", cs), Editor.concretes["EditorSpa"].rule("_52", cs));}, _54: function(cs){return Editor.concretes["EditorSpa"].rule("_53", cs).sel(Editor.concretes["EditorSpa"].rule("_19", cs));}, _55: function(cs){return Editor.concretes["EditorSpa"].rule("_54", cs).sel(Editor.concretes["EditorSpa"].rule("_21", cs));}, _58: function(cs){return cs[3].sel(new Int(1));}, _59: function(cs){return Editor.concretes["EditorSpa"].rule("_25", cs).sel(Editor.concretes["EditorSpa"].rule("_58", cs));}, _60: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_59", cs), Editor.concretes["EditorSpa"].rule("_31", cs));}, _61: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_60", cs), Editor.concretes["EditorSpa"].rule("_33", cs));}, _62: function(cs){return Editor.concretes["EditorSpa"].rule("_61", cs).sel(Editor.concretes["EditorSpa"].rule("_19", cs));}, _63: function(cs){return Editor.concretes["EditorSpa"].rule("_62", cs).sel(Editor.concretes["EditorSpa"].rule("_21", cs));}, _67: function(cs){return Editor.concretes["EditorSpa"].rule("_45", cs).sel(Editor.concretes["EditorSpa"].rule("_58", cs));}, _68: function(cs){return Editor.concretes["EditorSpa"].rule("_67", cs).sel(new Int(1));}, _69: function(cs){return new Arr(new Int(0), new Int(2));}, _70: function(cs){return Editor.concretes["EditorSpa"].rule("_69", cs).sel(Editor.concretes["EditorSpa"].rule("_58", cs));}, _71: function(cs){return Editor.concretes["EditorSpa"].rule("_49", cs).sel(Editor.concretes["EditorSpa"].rule("_70", cs));}, _72: function(cs){return cs[3].sel(new Int(0));}, _73: function(cs){return Editor.concretes["EditorSpa"].rule("_72", cs).sel(new Int(0));}, _74: function(cs){return new Seq(Editor.concretes["EditorSpa"].rule("_71", cs), Editor.concretes["EditorSpa"].rule("_73", cs));}, _75: function(cs){return new Seq(Editor.concretes["EditorSpa"].rule("_73", cs), Editor.concretes["EditorSpa"].rule("_71", cs));}, _76: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_74", cs), Editor.concretes["EditorSpa"].rule("_75", cs));}, _77: function(cs){return Editor.concretes["EditorSpa"].rule("_76", cs).sel(Editor.concretes["EditorSpa"].rule("_26", cs));}, _78: function(cs){return new Seq(Editor.concretes["EditorSpa"].rule("_68", cs), Editor.concretes["EditorSpa"].rule("_77", cs));}, _8: function(cs){return new Arr(new Str(""), new Str("s"));}, _89: function(cs){return new Arr(new Str("ar"), new Str("ar"), new Str("o"), new Str("as"), new Str("a"), new Str("amos"), new Str("áis"), new Str("an"), new Str("e"), new Str("es"), new Str("e"), new Str("emos"), new Str("éis"), new Str("en"), new Str("a"), new Str("emos"), new Str("ad"), new Str("ado"), new Str("ados"), new Str("ada"), new Str("adas"), new Str("ando"));}, _92: function(cs){return new Arr(new Str(""), new Str("es"));}, _95: function(cs){return new Arr(new Str("el"), new Str("el"), new Str("del"), new Str("al"));}, _96: function(cs){return new Seq(new Str("de"), new Str("la"));}, _97: function(cs){return new Seq(new Str("a"), new Str("la"));}, _98: function(cs){return new Arr(new Str("la"), new Str("la"), Editor.concretes["EditorSpa"].rule("_96", cs), Editor.concretes["EditorSpa"].rule("_97", cs));}, _99: function(cs){return new Arr(Editor.concretes["EditorSpa"].rule("_95", cs), Editor.concretes["EditorSpa"].rule("_98", cs));}, Adjective: function(cs){return new Arr(new Arr(Editor.concretes["EditorSpa"].rule("_253", cs), Editor.concretes["EditorSpa"].rule("_253", cs), Editor.concretes["EditorSpa"].rule("_253", cs)), new Int(0));}, Determiner: function(cs){return new Arr(new Arr(Editor.concretes["EditorSpa"].rule("_258", cs), Editor.concretes["EditorSpa"].rule("_258", cs)));}, Noun: function(cs){return new Arr(new Arr(cs[0], cs[0]), new Int(0));}, Sentence: function(cs){return new Arr(cs[0]);}, Verb: function(cs){return new Arr(new Arr(cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0]), new Int(0));}, "Int": function(cs){return new Arr(cs[0]);}, "Float": function(cs){return new Arr(cs[0]);}, "String": function(cs){return new Arr(cs[0]);}}, new Parser("Sentence",[new Rule(22, new FunApp("Wrapper",[]),[],[[new Terminal("envoltura")]]), new Rule(78, new FunApp("Wrapper",[]),[],[[new Terminal("envolturas")]]), new Rule(20, new FunApp("Wrap",[]),[],[[new Terminal("envolver")]]), new Rule(46, new FunApp("Wrap",[]),[],[[new Terminal("envolver")]]), new Rule(45, new FunApp("Wrap",[]),[],[[new Terminal("envuelvo")]]), new Rule(44, new FunApp("Wrap",[]),[],[[new Terminal("envuelves")]]), new Rule(43, new FunApp("Wrap",[]),[],[[new Terminal("envuelve")]]), new Rule(42, new FunApp("Wrap",[]),[],[[new Terminal("envolvemos")]]), new Rule(41, new FunApp("Wrap",[]),[],[[new Terminal("envolvéis")]]), new Rule(40, new FunApp("Wrap",[]),[],[[new Terminal("envuelven")]]), new Rule(39, new FunApp("Wrap",[]),[],[[new Terminal("envuelva")]]), new Rule(38, new FunApp("Wrap",[]),[],[[new Terminal("envuelvas")]]), new Rule(37, new FunApp("Wrap",[]),[],[[new Terminal("envuelva")]]), new Rule(36, new FunApp("Wrap",[]),[],[[new Terminal("envolvamos")]]), new Rule(35, new FunApp("Wrap",[]),[],[[new Terminal("envolváis")]]), new Rule(34, new FunApp("Wrap",[]),[],[[new Terminal("envuelvan")]]), new Rule(33, new FunApp("Wrap",[]),[],[[new Terminal("envuelve")]]), new Rule(32, new FunApp("Wrap",[]),[],[[new Terminal("envolvamos")]]), new Rule(31, new FunApp("Wrap",[]),[],[[new Terminal("envolved")]]), new Rule(30, new FunApp("Wrap",[]),[],[[new Terminal("envolvido")]]), new Rule(29, new FunApp("Wrap",[]),[],[[new Terminal("envolvidos")]]), new Rule(28, new FunApp("Wrap",[]),[],[[new Terminal("envolvida")]]), new Rule(27, new FunApp("Wrap",[]),[],[[new Terminal("envolvidas")]]), new Rule(26, new FunApp("Wrap",[]),[],[[new Terminal("envolviendo")]]), new Rule(20, new FunApp("Undo",[]),[],[[new Terminal("deshacer")]]), new Rule(46, new FunApp("Undo",[]),[],[[new Terminal("deshacer")]]), new Rule(45, new FunApp("Undo",[]),[],[[new Terminal("deshago")]]), new Rule(44, new FunApp("Undo",[]),[],[[new Terminal("deshaces")]]), new Rule(43, new FunApp("Undo",[]),[],[[new Terminal("deshace")]]), new Rule(42, new FunApp("Undo",[]),[],[[new Terminal("deshacemos")]]), new Rule(41, new FunApp("Undo",[]),[],[[new Terminal("deshacéis")]]), new Rule(40, new FunApp("Undo",[]),[],[[new Terminal("deshacen")]]), new Rule(39, new FunApp("Undo",[]),[],[[new Terminal("deshaga")]]), new Rule(38, new FunApp("Undo",[]),[],[[new Terminal("deshagas")]]), new Rule(37, new FunApp("Undo",[]),[],[[new Terminal("deshaga")]]), new Rule(36, new FunApp("Undo",[]),[],[[new Terminal("deshagamos")]]), new Rule(35, new FunApp("Undo",[]),[],[[new Terminal("deshagáis")]]), new Rule(34, new FunApp("Undo",[]),[],[[new Terminal("deshagan")]]), new Rule(33, new FunApp("Undo",[]),[],[[new Terminal("deshaz")]]), new Rule(32, new FunApp("Undo",[]),[],[[new Terminal("deshagamos")]]), new Rule(31, new FunApp("Undo",[]),[],[[new Terminal("deshaced")]]), new Rule(30, new FunApp("Undo",[]),[],[[new Terminal("deshecho")]]), new Rule(29, new FunApp("Undo",[]),[],[[new Terminal("deshechos")]]), new Rule(28, new FunApp("Undo",[]),[],[[new Terminal("deshecha")]]), new Rule(27, new FunApp("Undo",[]),[],[[new Terminal("deshechas")]]), new Rule(26, new FunApp("Undo",[]),[],[[new Terminal("deshaciendo")]]), new Rule(17, new FunApp("Tree",[]),[],[[new Terminal("árbol")]]), new Rule(16, new FunApp("Tree",[]),[],[[new Terminal("árboles")]]), new Rule(17, new FunApp("Swedish",[]),[],[[new Terminal("Sueco")]]), new Rule(16, new FunApp("Swedish",[]),[],[[new Terminal("Suecos")]]), new Rule(22, new FunApp("String_N",[]),[],[[new Terminal("cadena"), new Terminal("de"), new Terminal("caracteres")]]), new Rule(78, new FunApp("String_N",[]),[],[[new Terminal("cadenas"), new Terminal("de"), new Terminal("caracteres")]]), new Rule(17, new FunApp("Spanish",[]),[],[[new Terminal("Español")]]), new Rule(16, new FunApp("Spanish",[]),[],[[new Terminal("Españoles")]]), new Rule(18, new FunApp("SingleWordCommand",[new Arg(0)]),[21],[[new ArgProj(0, 0), new Terminal("&+"), new Terminal("se")]]), new Rule(18, new FunApp("SingleWordCommand",[new Arg(0)]),[20],[[new ArgProj(0, 0)]]), new Rule(20, new FunApp("Show",[]),[],[[new Terminal("Mostrar")]]), new Rule(46, new FunApp("Show",[]),[],[[new Terminal("Mostrar")]]), new Rule(45, new FunApp("Show",[]),[],[[new Terminal("Mostro")]]), new Rule(44, new FunApp("Show",[]),[],[[new Terminal("Mostras")]]), new Rule(43, new FunApp("Show",[]),[],[[new Terminal("Mostra")]]), new Rule(42, new FunApp("Show",[]),[],[[new Terminal("Mostramos")]]), new Rule(41, new FunApp("Show",[]),[],[[new Terminal("Mostráis")]]), new Rule(40, new FunApp("Show",[]),[],[[new Terminal("Mostran")]]), new Rule(39, new FunApp("Show",[]),[],[[new Terminal("Mostre")]]), new Rule(38, new FunApp("Show",[]),[],[[new Terminal("Mostres")]]), new Rule(37, new FunApp("Show",[]),[],[[new Terminal("Mostre")]]), new Rule(36, new FunApp("Show",[]),[],[[new Terminal("Mostremos")]]), new Rule(35, new FunApp("Show",[]),[],[[new Terminal("Mostréis")]]), new Rule(34, new FunApp("Show",[]),[],[[new Terminal("Mostren")]]), new Rule(33, new FunApp("Show",[]),[],[[new Terminal("Mostra")]]), new Rule(32, new FunApp("Show",[]),[],[[new Terminal("Mostremos")]]), new Rule(31, new FunApp("Show",[]),[],[[new Terminal("Mostrad")]]), new Rule(30, new FunApp("Show",[]),[],[[new Terminal("Mostrado")]]), new Rule(29, new FunApp("Show",[]),[],[[new Terminal("Mostrados")]]), new Rule(28, new FunApp("Show",[]),[],[[new Terminal("Mostrada")]]), new Rule(27, new FunApp("Show",[]),[],[[new Terminal("Mostradas")]]), new Rule(26, new FunApp("Show",[]),[],[[new Terminal("Mostrando")]]), new Rule(20, new FunApp("Select",[]),[],[[new Terminal("Seleccionar")]]), new Rule(46, new FunApp("Select",[]),[],[[new Terminal("Seleccionar")]]), new Rule(45, new FunApp("Select",[]),[],[[new Terminal("Selecciono")]]), new Rule(44, new FunApp("Select",[]),[],[[new Terminal("Seleccionas")]]), new Rule(43, new FunApp("Select",[]),[],[[new Terminal("Selecciona")]]), new Rule(42, new FunApp("Select",[]),[],[[new Terminal("Seleccionamos")]]), new Rule(41, new FunApp("Select",[]),[],[[new Terminal("Seleccionáis")]]), new Rule(40, new FunApp("Select",[]),[],[[new Terminal("Seleccionan")]]), new Rule(39, new FunApp("Select",[]),[],[[new Terminal("Seleccione")]]), new Rule(38, new FunApp("Select",[]),[],[[new Terminal("Selecciones")]]), new Rule(37, new FunApp("Select",[]),[],[[new Terminal("Seleccione")]]), new Rule(36, new FunApp("Select",[]),[],[[new Terminal("Seleccionemos")]]), new Rule(35, new FunApp("Select",[]),[],[[new Terminal("Seleccionéis")]]), new Rule(34, new FunApp("Select",[]),[],[[new Terminal("Seleccionen")]]), new Rule(33, new FunApp("Select",[]),[],[[new Terminal("Selecciona")]]), new Rule(32, new FunApp("Select",[]),[],[[new Terminal("Seleccionemos")]]), new Rule(31, new FunApp("Select",[]),[],[[new Terminal("Seleccionad")]]), new Rule(30, new FunApp("Select",[]),[],[[new Terminal("Seleccionado")]]), new Rule(29, new FunApp("Select",[]),[],[[new Terminal("Seleccionados")]]), new Rule(28, new FunApp("Select",[]),[],[[new Terminal("Seleccionada")]]), new Rule(27, new FunApp("Select",[]),[],[[new Terminal("Seleccionadas")]]), new Rule(26, new FunApp("Select",[]),[],[[new Terminal("Seleccionando")]]), new Rule(17, new FunApp("Russian",[]),[],[[new Terminal("Ruso")]]), new Rule(16, new FunApp("Russian",[]),[],[[new Terminal("Rusos")]]), new Rule(20, new FunApp("Replace",[]),[],[[new Terminal("Reemplazar")]]), new Rule(46, new FunApp("Replace",[]),[],[[new Terminal("Reemplazar")]]), new Rule(45, new FunApp("Replace",[]),[],[[new Terminal("Reemplazo")]]), new Rule(44, new FunApp("Replace",[]),[],[[new Terminal("Reemplazas")]]), new Rule(43, new FunApp("Replace",[]),[],[[new Terminal("Reemplaza")]]), new Rule(42, new FunApp("Replace",[]),[],[[new Terminal("Reemplazamos")]]), new Rule(41, new FunApp("Replace",[]),[],[[new Terminal("Reemplazáis")]]), new Rule(40, new FunApp("Replace",[]),[],[[new Terminal("Reemplazan")]]), new Rule(39, new FunApp("Replace",[]),[],[[new Terminal("Reemplace")]]), new Rule(38, new FunApp("Replace",[]),[],[[new Terminal("Reemplaces")]]), new Rule(37, new FunApp("Replace",[]),[],[[new Terminal("Reemplace")]]), new Rule(36, new FunApp("Replace",[]),[],[[new Terminal("Reemplacemos")]]), new Rule(35, new FunApp("Replace",[]),[],[[new Terminal("Reemplacéis")]]), new Rule(34, new FunApp("Replace",[]),[],[[new Terminal("Reemplacen")]]), new Rule(33, new FunApp("Replace",[]),[],[[new Terminal("Reemplaza")]]), new Rule(32, new FunApp("Replace",[]),[],[[new Terminal("Reemplacemos")]]), new Rule(31, new FunApp("Replace",[]),[],[[new Terminal("Reemplazad")]]), new Rule(30, new FunApp("Replace",[]),[],[[new Terminal("Reemplazado")]]), new Rule(29, new FunApp("Replace",[]),[],[[new Terminal("Reemplazados")]]), new Rule(28, new FunApp("Replace",[]),[],[[new Terminal("Reemplazada")]]), new Rule(27, new FunApp("Replace",[]),[],[[new Terminal("Reemplazadas")]]), new Rule(26, new FunApp("Replace",[]),[],[[new Terminal("Reemplazando")]]), new Rule(17, new FunApp("Refinement",[]),[],[[new Terminal("refinamiento")]]), new Rule(16, new FunApp("Refinement",[]),[],[[new Terminal("refinamientos")]]), new Rule(20, new FunApp("Refine",[]),[],[[new Terminal("Refinar")]]), new Rule(46, new FunApp("Refine",[]),[],[[new Terminal("Refinar")]]), new Rule(45, new FunApp("Refine",[]),[],[[new Terminal("Refino")]]), new Rule(44, new FunApp("Refine",[]),[],[[new Terminal("Refinas")]]), new Rule(43, new FunApp("Refine",[]),[],[[new Terminal("Refina")]]), new Rule(42, new FunApp("Refine",[]),[],[[new Terminal("Refinamos")]]), new Rule(41, new FunApp("Refine",[]),[],[[new Terminal("Refináis")]]), new Rule(40, new FunApp("Refine",[]),[],[[new Terminal("Refinan")]]), new Rule(39, new FunApp("Refine",[]),[],[[new Terminal("Refine")]]), new Rule(38, new FunApp("Refine",[]),[],[[new Terminal("Refines")]]), new Rule(37, new FunApp("Refine",[]),[],[[new Terminal("Refine")]]), new Rule(36, new FunApp("Refine",[]),[],[[new Terminal("Refinemos")]]), new Rule(35, new FunApp("Refine",[]),[],[[new Terminal("Refinéis")]]), new Rule(34, new FunApp("Refine",[]),[],[[new Terminal("Refinen")]]), new Rule(33, new FunApp("Refine",[]),[],[[new Terminal("Refina")]]), new Rule(32, new FunApp("Refine",[]),[],[[new Terminal("Refinemos")]]), new Rule(31, new FunApp("Refine",[]),[],[[new Terminal("Refinad")]]), new Rule(30, new FunApp("Refine",[]),[],[[new Terminal("Refinado")]]), new Rule(29, new FunApp("Refine",[]),[],[[new Terminal("Refinados")]]), new Rule(28, new FunApp("Refine",[]),[],[[new Terminal("Refinada")]]), new Rule(27, new FunApp("Refine",[]),[],[[new Terminal("Refinadas")]]), new Rule(26, new FunApp("Refine",[]),[],[[new Terminal("Refinando")]]), new Rule(20, new FunApp("Redo",[]),[],[[new Terminal("rehacer")]]), new Rule(46, new FunApp("Redo",[]),[],[[new Terminal("rehacer")]]), new Rule(45, new FunApp("Redo",[]),[],[[new Terminal("rehago")]]), new Rule(44, new FunApp("Redo",[]),[],[[new Terminal("rehaces")]]), new Rule(43, new FunApp("Redo",[]),[],[[new Terminal("rehace")]]), new Rule(42, new FunApp("Redo",[]),[],[[new Terminal("rehacemos")]]), new Rule(41, new FunApp("Redo",[]),[],[[new Terminal("rehacéis")]]), new Rule(40, new FunApp("Redo",[]),[],[[new Terminal("rehacen")]]), new Rule(39, new FunApp("Redo",[]),[],[[new Terminal("rehaga")]]), new Rule(38, new FunApp("Redo",[]),[],[[new Terminal("rehagas")]]), new Rule(37, new FunApp("Redo",[]),[],[[new Terminal("rehaga")]]), new Rule(36, new FunApp("Redo",[]),[],[[new Terminal("rehagamos")]]), new Rule(35, new FunApp("Redo",[]),[],[[new Terminal("rehagáis")]]), new Rule(34, new FunApp("Redo",[]),[],[[new Terminal("rehagan")]]), new Rule(33, new FunApp("Redo",[]),[],[[new Terminal("rehaz")]]), new Rule(32, new FunApp("Redo",[]),[],[[new Terminal("rehagamos")]]), new Rule(31, new FunApp("Redo",[]),[],[[new Terminal("rehaced")]]), new Rule(30, new FunApp("Redo",[]),[],[[new Terminal("rehecho")]]), new Rule(29, new FunApp("Redo",[]),[],[[new Terminal("rehechos")]]), new Rule(28, new FunApp("Redo",[]),[],[[new Terminal("rehecha")]]), new Rule(27, new FunApp("Redo",[]),[],[[new Terminal("rehechas")]]), new Rule(26, new FunApp("Redo",[]),[],[[new Terminal("rehaciendo")]]), new Rule(18, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[21, 23, 22],[[new ArgProj(0, 0), new Terminal("&+"), new Terminal("se"), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("aleatoriamente")]]), new Rule(18, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[20, 23, 22],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("aleatoriamente")]]), new Rule(18, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[21, 19, 17],[[new ArgProj(0, 0), new Terminal("&+"), new Terminal("se"), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("aleatoriamente")]]), new Rule(18, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[20, 19, 17],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("aleatoriamente")]]), new Rule(15, new FunApp("Previous",[]),[],[[new Terminal("anterior")]]), new Rule(14, new FunApp("Previous",[]),[],[[new Terminal("anteriores")]]), new Rule(13, new FunApp("Previous",[]),[],[[new Terminal("anterior")]]), new Rule(12, new FunApp("Previous",[]),[],[[new Terminal("anteriores")]]), new Rule(11, new FunApp("Previous",[]),[],[[new Terminal("anteriormente")]]), new Rule(10, new FunApp("Previous",[]),[],[[new Terminal("más"), new Terminal("anterior")]]), new Rule(9, new FunApp("Previous",[]),[],[[new Terminal("más"), new Terminal("anteriores")]]), new Rule(8, new FunApp("Previous",[]),[],[[new Terminal("más"), new Terminal("anterior")]]), new Rule(7, new FunApp("Previous",[]),[],[[new Terminal("más"), new Terminal("anteriores")]]), new Rule(6, new FunApp("Previous",[]),[],[[new Terminal("más"), new Terminal("anteriormente")]]), new Rule(5, new FunApp("Previous",[]),[],[[new Terminal("más"), new Terminal("anterior")]]), new Rule(4, new FunApp("Previous",[]),[],[[new Terminal("más"), new Terminal("anteriores")]]), new Rule(3, new FunApp("Previous",[]),[],[[new Terminal("más"), new Terminal("anterior")]]), new Rule(2, new FunApp("Previous",[]),[],[[new Terminal("más"), new Terminal("anteriores")]]), new Rule(1, new FunApp("Previous",[]),[],[[new Terminal("más"), new Terminal("anteriormente")]]), new Rule(20, new FunApp("Paste",[]),[],[[new Terminal("Pegar")]]), new Rule(46, new FunApp("Paste",[]),[],[[new Terminal("Pegar")]]), new Rule(45, new FunApp("Paste",[]),[],[[new Terminal("Pego")]]), new Rule(44, new FunApp("Paste",[]),[],[[new Terminal("Pegas")]]), new Rule(43, new FunApp("Paste",[]),[],[[new Terminal("Pega")]]), new Rule(42, new FunApp("Paste",[]),[],[[new Terminal("Pegamos")]]), new Rule(41, new FunApp("Paste",[]),[],[[new Terminal("Pegáis")]]), new Rule(40, new FunApp("Paste",[]),[],[[new Terminal("Pegan")]]), new Rule(39, new FunApp("Paste",[]),[],[[new Terminal("Pegue")]]), new Rule(38, new FunApp("Paste",[]),[],[[new Terminal("Pegues")]]), new Rule(37, new FunApp("Paste",[]),[],[[new Terminal("Pegue")]]), new Rule(36, new FunApp("Paste",[]),[],[[new Terminal("Peguemos")]]), new Rule(35, new FunApp("Paste",[]),[],[[new Terminal("Peguéis")]]), new Rule(34, new FunApp("Paste",[]),[],[[new Terminal("Peguen")]]), new Rule(33, new FunApp("Paste",[]),[],[[new Terminal("Pega")]]), new Rule(32, new FunApp("Paste",[]),[],[[new Terminal("Peguemos")]]), new Rule(31, new FunApp("Paste",[]),[],[[new Terminal("Pegad")]]), new Rule(30, new FunApp("Paste",[]),[],[[new Terminal("Pegado")]]), new Rule(29, new FunApp("Paste",[]),[],[[new Terminal("Pegados")]]), new Rule(28, new FunApp("Paste",[]),[],[[new Terminal("Pegada")]]), new Rule(27, new FunApp("Paste",[]),[],[[new Terminal("Pegadas")]]), new Rule(26, new FunApp("Paste",[]),[],[[new Terminal("Pegando")]]), new Rule(20, new FunApp("Parse",[]),[],[[new Terminal("Analizar")]]), new Rule(46, new FunApp("Parse",[]),[],[[new Terminal("Analizar")]]), new Rule(45, new FunApp("Parse",[]),[],[[new Terminal("Analizo")]]), new Rule(44, new FunApp("Parse",[]),[],[[new Terminal("Analizas")]]), new Rule(43, new FunApp("Parse",[]),[],[[new Terminal("Analiza")]]), new Rule(42, new FunApp("Parse",[]),[],[[new Terminal("Analizamos")]]), new Rule(41, new FunApp("Parse",[]),[],[[new Terminal("Analizáis")]]), new Rule(40, new FunApp("Parse",[]),[],[[new Terminal("Analizan")]]), new Rule(39, new FunApp("Parse",[]),[],[[new Terminal("Analice")]]), new Rule(38, new FunApp("Parse",[]),[],[[new Terminal("Analices")]]), new Rule(37, new FunApp("Parse",[]),[],[[new Terminal("Analice")]]), new Rule(36, new FunApp("Parse",[]),[],[[new Terminal("Analicemos")]]), new Rule(35, new FunApp("Parse",[]),[],[[new Terminal("Analicéis")]]), new Rule(34, new FunApp("Parse",[]),[],[[new Terminal("Analicen")]]), new Rule(33, new FunApp("Parse",[]),[],[[new Terminal("Analiza")]]), new Rule(32, new FunApp("Parse",[]),[],[[new Terminal("Analicemos")]]), new Rule(31, new FunApp("Parse",[]),[],[[new Terminal("Analizad")]]), new Rule(30, new FunApp("Parse",[]),[],[[new Terminal("sintácticamente")]]), new Rule(29, new FunApp("Parse",[]),[],[[new Terminal("sintácticamentos")]]), new Rule(28, new FunApp("Parse",[]),[],[[new Terminal("sintácticamenta")]]), new Rule(27, new FunApp("Parse",[]),[],[[new Terminal("sintácticamentas")]]), new Rule(26, new FunApp("Parse",[]),[],[[new Terminal("Analizando")]]), new Rule(22, new FunApp("Page",[]),[],[[new Terminal("página")]]), new Rule(78, new FunApp("Page",[]),[],[[new Terminal("páginas")]]), new Rule(17, new FunApp("Norwegian",[]),[],[[new Terminal("Noruego")]]), new Rule(16, new FunApp("Norwegian",[]),[],[[new Terminal("Noruegos")]]), new Rule(17, new FunApp("Node",[]),[],[[new Terminal("nodo")]]), new Rule(16, new FunApp("Node",[]),[],[[new Terminal("nodos")]]), new Rule(15, new FunApp("Next",[]),[],[[new Terminal("siguiente")]]), new Rule(14, new FunApp("Next",[]),[],[[new Terminal("siguientes")]]), new Rule(13, new FunApp("Next",[]),[],[[new Terminal("siguiente")]]), new Rule(12, new FunApp("Next",[]),[],[[new Terminal("siguientes")]]), new Rule(11, new FunApp("Next",[]),[],[[new Terminal("siguientemente")]]), new Rule(10, new FunApp("Next",[]),[],[[new Terminal("más"), new Terminal("siguiente")]]), new Rule(9, new FunApp("Next",[]),[],[[new Terminal("más"), new Terminal("siguientes")]]), new Rule(8, new FunApp("Next",[]),[],[[new Terminal("más"), new Terminal("siguiente")]]), new Rule(7, new FunApp("Next",[]),[],[[new Terminal("más"), new Terminal("siguientes")]]), new Rule(6, new FunApp("Next",[]),[],[[new Terminal("más"), new Terminal("siguientemente")]]), new Rule(5, new FunApp("Next",[]),[],[[new Terminal("más"), new Terminal("siguiente")]]), new Rule(4, new FunApp("Next",[]),[],[[new Terminal("más"), new Terminal("siguientes")]]), new Rule(3, new FunApp("Next",[]),[],[[new Terminal("más"), new Terminal("siguiente")]]), new Rule(2, new FunApp("Next",[]),[],[[new Terminal("más"), new Terminal("siguientes")]]), new Rule(1, new FunApp("Next",[]),[],[[new Terminal("más"), new Terminal("siguientemente")]]), new Rule(17, new FunApp("Language",[]),[],[[new Terminal("lenguaje")]]), new Rule(16, new FunApp("Language",[]),[],[[new Terminal("lenguajes")]]), new Rule(18, new FunApp("Label",[new Arg(0)]),[77],[[new ArgProj(0, 0)]]), new Rule(77, new Arg(0),[22],[[new ArgProj(0, 0)]]), new Rule(77, new Arg(0),[17],[[new ArgProj(0, 0)]]), new Rule(17, new FunApp("Italian",[]),[],[[new Terminal("Italiano")]]), new Rule(16, new FunApp("Italian",[]),[],[[new Terminal("Italianos")]]), new Rule(17, new FunApp("Integer_N",[]),[],[[new Terminal("número"), new Terminal("entero")]]), new Rule(16, new FunApp("Integer_N",[]),[],[[new Terminal("números"), new Terminal("entero")]]), new Rule(76, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(75, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(74, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(73, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(72, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(71, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(70, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(69, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(68, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(67, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(66, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(65, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(64, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(63, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(62, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(61, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(60, new FunApp("IndefSgDet",[]),[],[[new Terminal("un")]]), new Rule(19, new FunApp("IndefSgDet",[]),[],[[new Terminal("un")]]), new Rule(59, new FunApp("IndefSgDet",[]),[],[[new Terminal("de"), new Terminal("un")]]), new Rule(58, new FunApp("IndefSgDet",[]),[],[[new Terminal("a"), new Terminal("un")]]), new Rule(57, new FunApp("IndefSgDet",[]),[],[[new Terminal("una")]]), new Rule(23, new FunApp("IndefSgDet",[]),[],[[new Terminal("una")]]), new Rule(56, new FunApp("IndefSgDet",[]),[],[[new Terminal("de"), new Terminal("una")]]), new Rule(55, new FunApp("IndefSgDet",[]),[],[[new Terminal("a"), new Terminal("una")]]), new Rule(54, new FunApp("IndefSgDet",[]),[],[[new Terminal("unos")]]), new Rule(53, new FunApp("IndefSgDet",[]),[],[[new Terminal("unos")]]), new Rule(52, new FunApp("IndefSgDet",[]),[],[[new Terminal("de"), new Terminal("unos")]]), new Rule(51, new FunApp("IndefSgDet",[]),[],[[new Terminal("a"), new Terminal("unos")]]), new Rule(50, new FunApp("IndefSgDet",[]),[],[[new Terminal("unas")]]), new Rule(49, new FunApp("IndefSgDet",[]),[],[[new Terminal("unas")]]), new Rule(48, new FunApp("IndefSgDet",[]),[],[[new Terminal("de"), new Terminal("unas")]]), new Rule(47, new FunApp("IndefSgDet",[]),[],[[new Terminal("a"), new Terminal("unas")]]), new Rule(76, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(75, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(74, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(73, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(72, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(71, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(70, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(69, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(68, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(67, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(66, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(65, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(64, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(63, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(62, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(61, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(60, new FunApp("IndefPlDet",[]),[],[[new Terminal("un")]]), new Rule(19, new FunApp("IndefPlDet",[]),[],[[new Terminal("un")]]), new Rule(59, new FunApp("IndefPlDet",[]),[],[[new Terminal("de"), new Terminal("un")]]), new Rule(58, new FunApp("IndefPlDet",[]),[],[[new Terminal("a"), new Terminal("un")]]), new Rule(57, new FunApp("IndefPlDet",[]),[],[[new Terminal("una")]]), new Rule(23, new FunApp("IndefPlDet",[]),[],[[new Terminal("una")]]), new Rule(56, new FunApp("IndefPlDet",[]),[],[[new Terminal("de"), new Terminal("una")]]), new Rule(55, new FunApp("IndefPlDet",[]),[],[[new Terminal("a"), new Terminal("una")]]), new Rule(54, new FunApp("IndefPlDet",[]),[],[[new Terminal("unos")]]), new Rule(53, new FunApp("IndefPlDet",[]),[],[[new Terminal("unos")]]), new Rule(52, new FunApp("IndefPlDet",[]),[],[[new Terminal("de"), new Terminal("unos")]]), new Rule(51, new FunApp("IndefPlDet",[]),[],[[new Terminal("a"), new Terminal("unos")]]), new Rule(50, new FunApp("IndefPlDet",[]),[],[[new Terminal("unas")]]), new Rule(49, new FunApp("IndefPlDet",[]),[],[[new Terminal("unas")]]), new Rule(48, new FunApp("IndefPlDet",[]),[],[[new Terminal("de"), new Terminal("unas")]]), new Rule(47, new FunApp("IndefPlDet",[]),[],[[new Terminal("a"), new Terminal("unas")]]), new Rule(17, new FunApp("German",[]),[],[[new Terminal("Alemán")]]), new Rule(16, new FunApp("German",[]),[],[[new Terminal("Alemánes")]]), new Rule(17, new FunApp("French",[]),[],[[new Terminal("Francés")]]), new Rule(16, new FunApp("French",[]),[],[[new Terminal("Francéses")]]), new Rule(17, new FunApp("Float_N",[]),[],[[new Terminal("número"), new Terminal("real")]]), new Rule(16, new FunApp("Float_N",[]),[],[[new Terminal("números"), new Terminal("real")]]), new Rule(17, new FunApp("Finnish",[]),[],[[new Terminal("Finlandés")]]), new Rule(16, new FunApp("Finnish",[]),[],[[new Terminal("Finlandéses")]]), new Rule(18, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[13, 22],[[new Terminal("no"), new Terminal("hay"), new Terminal("una"), new ArgProj(1, 0), new ArgProj(0, 0)]]), new Rule(18, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[15, 17],[[new Terminal("no"), new Terminal("hay"), new Terminal("un"), new ArgProj(1, 0), new ArgProj(0, 0)]]), new Rule(18, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[25, 22],[[new Terminal("no"), new Terminal("hay"), new Terminal("una"), new ArgProj(0, 0), new ArgProj(1, 0)]]), new Rule(18, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[24, 17],[[new Terminal("no"), new Terminal("hay"), new Terminal("un"), new ArgProj(0, 0), new ArgProj(1, 0)]]), new Rule(20, new FunApp("Enter",[]),[],[[new Terminal("introducir")]]), new Rule(46, new FunApp("Enter",[]),[],[[new Terminal("introducir")]]), new Rule(45, new FunApp("Enter",[]),[],[[new Terminal("introduzco")]]), new Rule(44, new FunApp("Enter",[]),[],[[new Terminal("introduces")]]), new Rule(43, new FunApp("Enter",[]),[],[[new Terminal("introduce")]]), new Rule(42, new FunApp("Enter",[]),[],[[new Terminal("introducimos")]]), new Rule(41, new FunApp("Enter",[]),[],[[new Terminal("introducís")]]), new Rule(40, new FunApp("Enter",[]),[],[[new Terminal("introducen")]]), new Rule(39, new FunApp("Enter",[]),[],[[new Terminal("introduzca")]]), new Rule(38, new FunApp("Enter",[]),[],[[new Terminal("introduzcas")]]), new Rule(37, new FunApp("Enter",[]),[],[[new Terminal("introduzca")]]), new Rule(36, new FunApp("Enter",[]),[],[[new Terminal("introduzcamos")]]), new Rule(35, new FunApp("Enter",[]),[],[[new Terminal("introduzcáis")]]), new Rule(34, new FunApp("Enter",[]),[],[[new Terminal("introduzcan")]]), new Rule(33, new FunApp("Enter",[]),[],[[new Terminal("introduce")]]), new Rule(32, new FunApp("Enter",[]),[],[[new Terminal("introduzcamos")]]), new Rule(31, new FunApp("Enter",[]),[],[[new Terminal("introducid")]]), new Rule(30, new FunApp("Enter",[]),[],[[new Terminal("introducido")]]), new Rule(29, new FunApp("Enter",[]),[],[[new Terminal("introducidos")]]), new Rule(28, new FunApp("Enter",[]),[],[[new Terminal("introducida")]]), new Rule(27, new FunApp("Enter",[]),[],[[new Terminal("introducidas")]]), new Rule(26, new FunApp("Enter",[]),[],[[new Terminal("introduciendo")]]), new Rule(17, new FunApp("English",[]),[],[[new Terminal("Inglés")]]), new Rule(16, new FunApp("English",[]),[],[[new Terminal("Ingléses")]]), new Rule(20, new FunApp("Delete",[]),[],[[new Terminal("Borrar")]]), new Rule(46, new FunApp("Delete",[]),[],[[new Terminal("Borrar")]]), new Rule(45, new FunApp("Delete",[]),[],[[new Terminal("Borro")]]), new Rule(44, new FunApp("Delete",[]),[],[[new Terminal("Borras")]]), new Rule(43, new FunApp("Delete",[]),[],[[new Terminal("Borra")]]), new Rule(42, new FunApp("Delete",[]),[],[[new Terminal("Borramos")]]), new Rule(41, new FunApp("Delete",[]),[],[[new Terminal("Borráis")]]), new Rule(40, new FunApp("Delete",[]),[],[[new Terminal("Borran")]]), new Rule(39, new FunApp("Delete",[]),[],[[new Terminal("Borre")]]), new Rule(38, new FunApp("Delete",[]),[],[[new Terminal("Borres")]]), new Rule(37, new FunApp("Delete",[]),[],[[new Terminal("Borre")]]), new Rule(36, new FunApp("Delete",[]),[],[[new Terminal("Borremos")]]), new Rule(35, new FunApp("Delete",[]),[],[[new Terminal("Borréis")]]), new Rule(34, new FunApp("Delete",[]),[],[[new Terminal("Borren")]]), new Rule(33, new FunApp("Delete",[]),[],[[new Terminal("Borra")]]), new Rule(32, new FunApp("Delete",[]),[],[[new Terminal("Borremos")]]), new Rule(31, new FunApp("Delete",[]),[],[[new Terminal("Borrad")]]), new Rule(30, new FunApp("Delete",[]),[],[[new Terminal("Borrado")]]), new Rule(29, new FunApp("Delete",[]),[],[[new Terminal("Borrados")]]), new Rule(28, new FunApp("Delete",[]),[],[[new Terminal("Borrada")]]), new Rule(27, new FunApp("Delete",[]),[],[[new Terminal("Borradas")]]), new Rule(26, new FunApp("Delete",[]),[],[[new Terminal("Borrando")]]), new Rule(76, new FunApp("DefSgDet",[]),[],[[new Terminal("el")]]), new Rule(75, new FunApp("DefSgDet",[]),[],[[new Terminal("el")]]), new Rule(74, new FunApp("DefSgDet",[]),[],[[new Terminal("del")]]), new Rule(73, new FunApp("DefSgDet",[]),[],[[new Terminal("al")]]), new Rule(72, new FunApp("DefSgDet",[]),[],[[new Terminal("la")]]), new Rule(71, new FunApp("DefSgDet",[]),[],[[new Terminal("la")]]), new Rule(70, new FunApp("DefSgDet",[]),[],[[new Terminal("de"), new Terminal("la")]]), new Rule(69, new FunApp("DefSgDet",[]),[],[[new Terminal("a"), new Terminal("la")]]), new Rule(68, new FunApp("DefSgDet",[]),[],[[new Terminal("los")]]), new Rule(67, new FunApp("DefSgDet",[]),[],[[new Terminal("los")]]), new Rule(66, new FunApp("DefSgDet",[]),[],[[new Terminal("de"), new Terminal("los")]]), new Rule(65, new FunApp("DefSgDet",[]),[],[[new Terminal("a"), new Terminal("los")]]), new Rule(64, new FunApp("DefSgDet",[]),[],[[new Terminal("las")]]), new Rule(63, new FunApp("DefSgDet",[]),[],[[new Terminal("las")]]), new Rule(62, new FunApp("DefSgDet",[]),[],[[new Terminal("de"), new Terminal("las")]]), new Rule(61, new FunApp("DefSgDet",[]),[],[[new Terminal("a"), new Terminal("las")]]), new Rule(60, new FunApp("DefSgDet",[]),[],[[new Terminal("el")]]), new Rule(19, new FunApp("DefSgDet",[]),[],[[new Terminal("el")]]), new Rule(59, new FunApp("DefSgDet",[]),[],[[new Terminal("del")]]), new Rule(58, new FunApp("DefSgDet",[]),[],[[new Terminal("al")]]), new Rule(57, new FunApp("DefSgDet",[]),[],[[new Terminal("la")]]), new Rule(23, new FunApp("DefSgDet",[]),[],[[new Terminal("la")]]), new Rule(56, new FunApp("DefSgDet",[]),[],[[new Terminal("de"), new Terminal("la")]]), new Rule(55, new FunApp("DefSgDet",[]),[],[[new Terminal("a"), new Terminal("la")]]), new Rule(54, new FunApp("DefSgDet",[]),[],[[new Terminal("los")]]), new Rule(53, new FunApp("DefSgDet",[]),[],[[new Terminal("los")]]), new Rule(52, new FunApp("DefSgDet",[]),[],[[new Terminal("de"), new Terminal("los")]]), new Rule(51, new FunApp("DefSgDet",[]),[],[[new Terminal("a"), new Terminal("los")]]), new Rule(50, new FunApp("DefSgDet",[]),[],[[new Terminal("las")]]), new Rule(49, new FunApp("DefSgDet",[]),[],[[new Terminal("las")]]), new Rule(48, new FunApp("DefSgDet",[]),[],[[new Terminal("de"), new Terminal("las")]]), new Rule(47, new FunApp("DefSgDet",[]),[],[[new Terminal("a"), new Terminal("las")]]), new Rule(76, new FunApp("DefPlDet",[]),[],[[new Terminal("el")]]), new Rule(75, new FunApp("DefPlDet",[]),[],[[new Terminal("el")]]), new Rule(74, new FunApp("DefPlDet",[]),[],[[new Terminal("del")]]), new Rule(73, new FunApp("DefPlDet",[]),[],[[new Terminal("al")]]), new Rule(72, new FunApp("DefPlDet",[]),[],[[new Terminal("la")]]), new Rule(71, new FunApp("DefPlDet",[]),[],[[new Terminal("la")]]), new Rule(70, new FunApp("DefPlDet",[]),[],[[new Terminal("de"), new Terminal("la")]]), new Rule(69, new FunApp("DefPlDet",[]),[],[[new Terminal("a"), new Terminal("la")]]), new Rule(68, new FunApp("DefPlDet",[]),[],[[new Terminal("los")]]), new Rule(67, new FunApp("DefPlDet",[]),[],[[new Terminal("los")]]), new Rule(66, new FunApp("DefPlDet",[]),[],[[new Terminal("de"), new Terminal("los")]]), new Rule(65, new FunApp("DefPlDet",[]),[],[[new Terminal("a"), new Terminal("los")]]), new Rule(64, new FunApp("DefPlDet",[]),[],[[new Terminal("las")]]), new Rule(63, new FunApp("DefPlDet",[]),[],[[new Terminal("las")]]), new Rule(62, new FunApp("DefPlDet",[]),[],[[new Terminal("de"), new Terminal("las")]]), new Rule(61, new FunApp("DefPlDet",[]),[],[[new Terminal("a"), new Terminal("las")]]), new Rule(60, new FunApp("DefPlDet",[]),[],[[new Terminal("el")]]), new Rule(19, new FunApp("DefPlDet",[]),[],[[new Terminal("el")]]), new Rule(59, new FunApp("DefPlDet",[]),[],[[new Terminal("del")]]), new Rule(58, new FunApp("DefPlDet",[]),[],[[new Terminal("al")]]), new Rule(57, new FunApp("DefPlDet",[]),[],[[new Terminal("la")]]), new Rule(23, new FunApp("DefPlDet",[]),[],[[new Terminal("la")]]), new Rule(56, new FunApp("DefPlDet",[]),[],[[new Terminal("de"), new Terminal("la")]]), new Rule(55, new FunApp("DefPlDet",[]),[],[[new Terminal("a"), new Terminal("la")]]), new Rule(54, new FunApp("DefPlDet",[]),[],[[new Terminal("los")]]), new Rule(53, new FunApp("DefPlDet",[]),[],[[new Terminal("los")]]), new Rule(52, new FunApp("DefPlDet",[]),[],[[new Terminal("de"), new Terminal("los")]]), new Rule(51, new FunApp("DefPlDet",[]),[],[[new Terminal("a"), new Terminal("los")]]), new Rule(50, new FunApp("DefPlDet",[]),[],[[new Terminal("las")]]), new Rule(49, new FunApp("DefPlDet",[]),[],[[new Terminal("las")]]), new Rule(48, new FunApp("DefPlDet",[]),[],[[new Terminal("de"), new Terminal("las")]]), new Rule(47, new FunApp("DefPlDet",[]),[],[[new Terminal("a"), new Terminal("las")]]), new Rule(17, new FunApp("Danish",[]),[],[[new Terminal("Danés")]]), new Rule(16, new FunApp("Danish",[]),[],[[new Terminal("Danéses")]]), new Rule(20, new FunApp("Cut",[]),[],[[new Terminal("Cortar")]]), new Rule(46, new FunApp("Cut",[]),[],[[new Terminal("Cortar")]]), new Rule(45, new FunApp("Cut",[]),[],[[new Terminal("Corto")]]), new Rule(44, new FunApp("Cut",[]),[],[[new Terminal("Cortas")]]), new Rule(43, new FunApp("Cut",[]),[],[[new Terminal("Corta")]]), new Rule(42, new FunApp("Cut",[]),[],[[new Terminal("Cortamos")]]), new Rule(41, new FunApp("Cut",[]),[],[[new Terminal("Cortáis")]]), new Rule(40, new FunApp("Cut",[]),[],[[new Terminal("Cortan")]]), new Rule(39, new FunApp("Cut",[]),[],[[new Terminal("Corte")]]), new Rule(38, new FunApp("Cut",[]),[],[[new Terminal("Cortes")]]), new Rule(37, new FunApp("Cut",[]),[],[[new Terminal("Corte")]]), new Rule(36, new FunApp("Cut",[]),[],[[new Terminal("Cortemos")]]), new Rule(35, new FunApp("Cut",[]),[],[[new Terminal("Cortéis")]]), new Rule(34, new FunApp("Cut",[]),[],[[new Terminal("Corten")]]), new Rule(33, new FunApp("Cut",[]),[],[[new Terminal("Corta")]]), new Rule(32, new FunApp("Cut",[]),[],[[new Terminal("Cortemos")]]), new Rule(31, new FunApp("Cut",[]),[],[[new Terminal("Cortad")]]), new Rule(30, new FunApp("Cut",[]),[],[[new Terminal("Cortado")]]), new Rule(29, new FunApp("Cut",[]),[],[[new Terminal("Cortados")]]), new Rule(28, new FunApp("Cut",[]),[],[[new Terminal("Cortada")]]), new Rule(27, new FunApp("Cut",[]),[],[[new Terminal("Cortadas")]]), new Rule(26, new FunApp("Cut",[]),[],[[new Terminal("Cortando")]]), new Rule(20, new FunApp("Copy",[]),[],[[new Terminal("Copiar")]]), new Rule(46, new FunApp("Copy",[]),[],[[new Terminal("Copiar")]]), new Rule(45, new FunApp("Copy",[]),[],[[new Terminal("Copío")]]), new Rule(44, new FunApp("Copy",[]),[],[[new Terminal("Copías")]]), new Rule(43, new FunApp("Copy",[]),[],[[new Terminal("Copía")]]), new Rule(42, new FunApp("Copy",[]),[],[[new Terminal("Copiamos")]]), new Rule(41, new FunApp("Copy",[]),[],[[new Terminal("Copiáis")]]), new Rule(40, new FunApp("Copy",[]),[],[[new Terminal("Copían")]]), new Rule(39, new FunApp("Copy",[]),[],[[new Terminal("Copíe")]]), new Rule(38, new FunApp("Copy",[]),[],[[new Terminal("Copíes")]]), new Rule(37, new FunApp("Copy",[]),[],[[new Terminal("Copíe")]]), new Rule(36, new FunApp("Copy",[]),[],[[new Terminal("Copiemos")]]), new Rule(35, new FunApp("Copy",[]),[],[[new Terminal("Copiéis")]]), new Rule(34, new FunApp("Copy",[]),[],[[new Terminal("Copíen")]]), new Rule(33, new FunApp("Copy",[]),[],[[new Terminal("Copía")]]), new Rule(32, new FunApp("Copy",[]),[],[[new Terminal("Copiemos")]]), new Rule(31, new FunApp("Copy",[]),[],[[new Terminal("Copiad")]]), new Rule(30, new FunApp("Copy",[]),[],[[new Terminal("Copiado")]]), new Rule(29, new FunApp("Copy",[]),[],[[new Terminal("Copiados")]]), new Rule(28, new FunApp("Copy",[]),[],[[new Terminal("Copiada")]]), new Rule(27, new FunApp("Copy",[]),[],[[new Terminal("Copiadas")]]), new Rule(26, new FunApp("Copy",[]),[],[[new Terminal("Copiando")]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[21, 23, 13, 22],[[new ArgProj(0, 0), new Terminal("&+"), new Terminal("se"), new ArgProj(1, 0), new ArgProj(3, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[20, 23, 13, 22],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(3, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[21, 19, 15, 17],[[new ArgProj(0, 0), new Terminal("&+"), new Terminal("se"), new ArgProj(1, 0), new ArgProj(3, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[20, 19, 15, 17],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(3, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[21, 23, 25, 22],[[new ArgProj(0, 0), new Terminal("&+"), new Terminal("se"), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[20, 23, 25, 22],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[21, 19, 24, 17],[[new ArgProj(0, 0), new Terminal("&+"), new Terminal("se"), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(18, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[20, 19, 24, 17],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(18, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[21, 23, 22],[[new ArgProj(0, 0), new Terminal("&+"), new Terminal("se"), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[20, 23, 22],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[21, 19, 17],[[new ArgProj(0, 0), new Terminal("&+"), new Terminal("se"), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(18, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[20, 19, 17],[[new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(17, new FunApp("Bulgarian",[]),[],[[new Terminal("Búlgaro")]]), new Rule(16, new FunApp("Bulgarian",[]),[],[[new Terminal("Búlgaros")]]), new Rule(15, new FunApp("Available",[]),[],[[new Terminal("disponible")]]), new Rule(14, new FunApp("Available",[]),[],[[new Terminal("disponibles")]]), new Rule(13, new FunApp("Available",[]),[],[[new Terminal("disponible")]]), new Rule(12, new FunApp("Available",[]),[],[[new Terminal("disponibles")]]), new Rule(11, new FunApp("Available",[]),[],[[new Terminal("disponiblemente")]]), new Rule(10, new FunApp("Available",[]),[],[[new Terminal("más"), new Terminal("disponible")]]), new Rule(9, new FunApp("Available",[]),[],[[new Terminal("más"), new Terminal("disponibles")]]), new Rule(8, new FunApp("Available",[]),[],[[new Terminal("más"), new Terminal("disponible")]]), new Rule(7, new FunApp("Available",[]),[],[[new Terminal("más"), new Terminal("disponibles")]]), new Rule(6, new FunApp("Available",[]),[],[[new Terminal("más"), new Terminal("disponiblemente")]]), new Rule(5, new FunApp("Available",[]),[],[[new Terminal("más"), new Terminal("disponible")]]), new Rule(4, new FunApp("Available",[]),[],[[new Terminal("más"), new Terminal("disponibles")]]), new Rule(3, new FunApp("Available",[]),[],[[new Terminal("más"), new Terminal("disponible")]]), new Rule(2, new FunApp("Available",[]),[],[[new Terminal("más"), new Terminal("disponibles")]]), new Rule(1, new FunApp("Available",[]),[],[[new Terminal("más"), new Terminal("disponiblemente")]])],{Adjective:[24, 15, 10, 5, 14, 9, 4, 25, 13, 8, 3, 12, 7, 2, 11, 6, 1], Determiner:[76, 60, 68, 54, 72, 57, 64, 50, 75, 19, 67, 53, 71, 23, 63, 49, 74, 59, 66, 52, 70, 56, 62, 48, 73, 58, 65, 51, 69, 55, 61, 47], Float:[-3], Int:[-2], Noun:[77, 17, 22, 16, 78], Sentence:[18], String:[-1], Verb:[20, 21, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26], _Var:[-4]})), EditorSwe: new GFConcrete({coding: "utf8"},{Available: function(cs){return new Arr(new Suffix("tillgänglig", Editor.concretes["EditorSwe"].rule("_0", cs)), new Int(1));}, Bulgarian: function(cs){return new Arr(new Arr(new Arr(new Suffix("Bulgariska", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Bulgariskan", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(new Suffix("Bulgariskor", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Bulgariskorna", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(0));}, Command: function(cs){return new Arr(new Seq(Editor.concretes["EditorSwe"].rule("_16", cs), Editor.concretes["EditorSwe"].rule("_17", cs), Editor.concretes["EditorSwe"].rule("_23", cs), Editor.concretes["EditorSwe"].rule("_47", cs), Editor.concretes["EditorSwe"].rule("_62", cs), Editor.concretes["EditorSwe"].rule("_64", cs)));}, CommandAdj: function(cs){return new Arr(new Seq(Editor.concretes["EditorSwe"].rule("_16", cs), Editor.concretes["EditorSwe"].rule("_17", cs), Editor.concretes["EditorSwe"].rule("_67", cs).sel(new Int(1)).sel(Editor.concretes["EditorSwe"].rule("_69", cs)),(new Arr(new Seq(Editor.concretes["EditorSwe"].rule("_75", cs).sel(Editor.concretes["EditorSwe"].rule("_80", cs).sel(Editor.concretes["EditorSwe"].rule("_86", cs).sel(new Int(0))).sel(Editor.concretes["EditorSwe"].rule("_86", cs).sel(new Int(1)))), Editor.concretes["EditorSwe"].rule("_95", cs)), new Seq(Editor.concretes["EditorSwe"].rule("_75", cs).sel(Editor.concretes["EditorSwe"].rule("_80", cs).sel(Editor.concretes["EditorSwe"].rule("_97", cs).sel(new Int(0))).sel(Editor.concretes["EditorSwe"].rule("_97", cs).sel(new Int(1)))), Editor.concretes["EditorSwe"].rule("_95", cs)), new Seq(Editor.concretes["EditorSwe"].rule("_75", cs).sel(Editor.concretes["EditorSwe"].rule("_80", cs).sel(Editor.concretes["EditorSwe"].rule("_105", cs)).sel(Editor.concretes["EditorSwe"].rule("_107", cs))), Editor.concretes["EditorSwe"].rule("_93", cs).sel(new Int(1)).sel(new Int(0))))).sel(Editor.concretes["EditorSwe"].rule("_38", cs).sel(Editor.concretes["EditorSwe"].rule("_114", cs).sel(new Int(0))).sel(Editor.concretes["EditorSwe"].rule("_114", cs).sel(new Int(1))).sel(Editor.concretes["EditorSwe"].rule("_114", cs).sel(new Int(2)))), Editor.concretes["EditorSwe"].rule("_50", cs).sel(Editor.concretes["EditorSwe"].rule("_105", cs)).sel(Editor.concretes["EditorSwe"].rule("_107", cs)), Editor.concretes["EditorSwe"].rule("_64", cs)));}, Copy: function(cs){return new Arr(new Suffix("Kopiera", Editor.concretes["EditorSwe"].rule("_126", cs)), Editor.concretes["EditorSwe"].rule("_48", cs), new Int(0));}, Cut: function(cs){return new Arr(new Suffix("Klipp", Editor.concretes["EditorSwe"].rule("_129", cs)), new Str("ut"), new Int(0));}, Danish: function(cs){return new Arr(new Arr(new Arr(new Suffix("Danska", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Danskan", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(new Suffix("Danskor", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Danskorna", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(0));}, DefPlDet: function(cs){return Editor.concretes["EditorSwe"].rule("_152", cs);}, DefSgDet: function(cs){return Editor.concretes["EditorSwe"].rule("_152", cs);}, Delete: function(cs){return new Arr(new Suffix("Radera", Editor.concretes["EditorSwe"].rule("_126", cs)), Editor.concretes["EditorSwe"].rule("_48", cs), new Int(0));}, English: function(cs){return new Arr(new Arr(new Arr(new Suffix("Engelska", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Engelskan", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(new Suffix("Engelskor", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Engelskorna", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(0));}, Enter: function(cs){return new Arr(new Suffix("Skriv", new Arr(new Str("er"), new Str("s"), new Str(""), new Str("s"), new Str("a"), new Str("as"), new Str("d"), new Str("ds"), new Str("t"), new Str("ts"), new Str("da"), new Str("das"), new Str("da"), new Str("das"), new Str("da"), new Str("das"))), Editor.concretes["EditorSwe"].rule("_48", cs), new Int(0));}, ErrorMessage: function(cs){return new Arr(new Seq(new Str("det"), new Str("finns"), new Str("inte"),(new Arr(new Str("en"), new Str("ett"))).sel(Editor.concretes["EditorSwe"].rule("_39", cs)),(new Arr(new Seq(Editor.concretes["EditorSwe"].rule("_173", cs).sel(Editor.concretes["EditorSwe"].rule("_177", cs).sel(Editor.concretes["EditorSwe"].rule("_183", cs).sel(new Int(0))).sel(Editor.concretes["EditorSwe"].rule("_183", cs).sel(new Int(1)))), Editor.concretes["EditorSwe"].rule("_189", cs)), new Seq(Editor.concretes["EditorSwe"].rule("_173", cs).sel(Editor.concretes["EditorSwe"].rule("_177", cs).sel(Editor.concretes["EditorSwe"].rule("_191", cs).sel(new Int(0))).sel(Editor.concretes["EditorSwe"].rule("_191", cs).sel(new Int(1)))), Editor.concretes["EditorSwe"].rule("_189", cs)), new Seq(Editor.concretes["EditorSwe"].rule("_173", cs).sel(Editor.concretes["EditorSwe"].rule("_177", cs).sel(Editor.concretes["EditorSwe"].rule("_198", cs).sel(new Int(0))).sel(Editor.concretes["EditorSwe"].rule("_198", cs).sel(new Int(1)))), Editor.concretes["EditorSwe"].rule("_20", cs).sel(new Int(0))))).sel(Editor.concretes["EditorSwe"].rule("_38", cs).sel(Editor.concretes["EditorSwe"].rule("_207", cs).sel(new Int(0))).sel(Editor.concretes["EditorSwe"].rule("_207", cs).sel(new Int(1))).sel(Editor.concretes["EditorSwe"].rule("_207", cs).sel(new Int(2))))));}, Finnish: function(cs){return new Arr(new Arr(new Arr(new Suffix("Finska", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Finskan", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(new Suffix("Finskor", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Finskorna", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(0));}, Float_N: function(cs){return new Arr(new Arr(new Arr(Editor.concretes["EditorSwe"].rule("_225", cs), new Suffix("flyttalet", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(Editor.concretes["EditorSwe"].rule("_225", cs), new Suffix("flyttalen", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(1));}, French: function(cs){return new Arr(new Arr(new Arr(new Suffix("Franska", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Franskan", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(new Suffix("Franskor", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Franskorna", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(0));}, German: function(cs){return new Arr(new Arr(new Arr(new Suffix("Tyska", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Tyskan", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(new Suffix("Tyskor", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Tyskorna", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(0));}, IndefPlDet: function(cs){return Editor.concretes["EditorSwe"].rule("_255", cs);}, IndefSgDet: function(cs){return Editor.concretes["EditorSwe"].rule("_255", cs);}, Integer_N: function(cs){return new Arr(new Arr(new Arr(Editor.concretes["EditorSwe"].rule("_256", cs), new Suffix("heltalet", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(Editor.concretes["EditorSwe"].rule("_256", cs), new Suffix("heltalen", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(1));}, Italian: function(cs){return new Arr(new Arr(new Arr(new Suffix("Italienska", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Italienskan", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(new Suffix("Italienskor", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Italienskorna", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(0));}, Label: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_168", cs).sel(new Int(0)).sel(new Int(0)));}, Language: function(cs){return new Arr(new Arr(new Arr(Editor.concretes["EditorSwe"].rule("_274", cs), new Suffix("språket", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(Editor.concretes["EditorSwe"].rule("_274", cs), new Suffix("språken", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(1));}, Next: function(cs){return new Arr(new Suffix("näst", Editor.concretes["EditorSwe"].rule("_0", cs)), new Int(1));}, Node: function(cs){return new Arr(new Arr(new Arr(new Suffix("nod", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("noden", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(new Suffix("nodar", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("nodarna", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(0));}, Norwegian: function(cs){return new Arr(new Arr(new Arr(new Suffix("Norska", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Norskan", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(new Suffix("Norskor", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Norskorna", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(0));}, Page: function(cs){return new Arr(new Arr(new Arr(new Suffix("sida", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("sidan", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(new Suffix("sidor", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("sidorna", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(0));}, Parse: function(cs){return new Arr(new Suffix("Parsa", Editor.concretes["EditorSwe"].rule("_126", cs)), Editor.concretes["EditorSwe"].rule("_48", cs), new Int(0));}, Paste: function(cs){return new Arr(new Suffix("Klistra", Editor.concretes["EditorSwe"].rule("_126", cs)), new Str("in"), new Int(0));}, Previous: function(cs){return new Arr(new Arr(new Str("föregående"), new Str("föregåendes"), new Str("föregående"), new Str("föregåendes"), new Str("föregående"), new Str("föregåendes"), new Str("föregående"), new Str("föregåendes"), new Str("föregående"), new Str("föregåendes"), Editor.concretes["EditorSwe"].rule("_48", cs), new Str("s"), Editor.concretes["EditorSwe"].rule("_48", cs), new Str("s"), new Str("a"), new Str("as")), new Int(1));}, RandomlyCommand: function(cs){return new Arr(new Seq(Editor.concretes["EditorSwe"].rule("_16", cs), Editor.concretes["EditorSwe"].rule("_17", cs), Editor.concretes["EditorSwe"].rule("_23", cs), Editor.concretes["EditorSwe"].rule("_47", cs), Editor.concretes["EditorSwe"].rule("_62", cs), Editor.concretes["EditorSwe"].rule("_64", cs), new Str("slumpmässigt")));}, Redo: function(cs){return new Arr(new Suffix("Upprepa", Editor.concretes["EditorSwe"].rule("_126", cs)), Editor.concretes["EditorSwe"].rule("_48", cs), new Int(0));}, Refine: function(cs){return new Arr(new Suffix("Raffinera", Editor.concretes["EditorSwe"].rule("_126", cs)), Editor.concretes["EditorSwe"].rule("_48", cs), new Int(0));}, Refinement: function(cs){return new Arr(new Arr(new Arr(new Suffix("raffinemang", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("raffinemangen", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(new Suffix("raffinemangar", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("raffinemangarna", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(0));}, Replace: function(cs){return new Arr(new Suffix("Ersätt", Editor.concretes["EditorSwe"].rule("_129", cs)), Editor.concretes["EditorSwe"].rule("_48", cs), new Int(0));}, Russian: function(cs){return new Arr(new Arr(new Arr(new Suffix("Ryska", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Ryskan", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(new Suffix("Ryskor", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Ryskorna", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(0));}, Select: function(cs){return new Arr(new Suffix("Välj", Editor.concretes["EditorSwe"].rule("_129", cs)), Editor.concretes["EditorSwe"].rule("_48", cs), new Int(0));}, Show: function(cs){return new Arr(new Suffix("Visa", Editor.concretes["EditorSwe"].rule("_126", cs)), Editor.concretes["EditorSwe"].rule("_48", cs), new Int(0));}, SingleWordCommand: function(cs){return new Arr(new Seq(Editor.concretes["EditorSwe"].rule("_16", cs), Editor.concretes["EditorSwe"].rule("_17", cs),(new Arr(Editor.concretes["EditorSwe"].rule("_345", cs), Editor.concretes["EditorSwe"].rule("_345", cs), new Arr((new Arr(Editor.concretes["EditorSwe"].rule("_48", cs), Editor.concretes["EditorSwe"].rule("_48", cs), new Str("oss"))).sel(Editor.concretes["EditorSwe"].rule("_14", cs)),(new Arr(Editor.concretes["EditorSwe"].rule("_48", cs), Editor.concretes["EditorSwe"].rule("_48", cs), new Str("er"))).sel(Editor.concretes["EditorSwe"].rule("_14", cs)), Editor.concretes["EditorSwe"].rule("_344", cs)))).sel(Editor.concretes["EditorSwe"].rule("_76", cs).sel(new Int(0))).sel(Editor.concretes["EditorSwe"].rule("_76", cs).sel(new Int(1)))));}, Spanish: function(cs){return new Arr(new Arr(new Arr(new Suffix("Spanska", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Spanskan", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(new Suffix("Spanskor", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Spanskorna", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(0));}, String_N: function(cs){return new Arr(new Arr(new Arr(new Suffix("sträng", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("strängen", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(new Suffix("strängar", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("strängarna", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(0));}, Swedish: function(cs){return new Arr(new Arr(new Arr(new Suffix("Svenska", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Svenskan", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(new Suffix("Svenskor", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("Svenskorna", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(0));}, Tree: function(cs){return new Arr(new Arr(new Arr(Editor.concretes["EditorSwe"].rule("_382", cs), new Suffix("trädet", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(Editor.concretes["EditorSwe"].rule("_382", cs), new Suffix("träden", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(1));}, Undo: function(cs){return new Arr(new Suffix("Ångra", Editor.concretes["EditorSwe"].rule("_126", cs)), Editor.concretes["EditorSwe"].rule("_48", cs), new Int(0));}, Wrap: function(cs){return new Arr(new Suffix("Förpacka", Editor.concretes["EditorSwe"].rule("_126", cs)), Editor.concretes["EditorSwe"].rule("_48", cs), new Int(0));}, Wrapper: function(cs){return new Arr(new Arr(new Arr(new Suffix("förpackning", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("förpackningen", Editor.concretes["EditorSwe"].rule("_3", cs))), new Arr(new Suffix("förpackningar", Editor.concretes["EditorSwe"].rule("_3", cs)), new Suffix("förpackningarna", Editor.concretes["EditorSwe"].rule("_3", cs)))), new Int(0));}, _0: function(cs){return new Arr(new Str(""), new Str("s"), new Str("t"), new Str("ts"), new Str("a"), new Str("as"), new Str("a"), new Str("as"), new Str("a"), new Str("as"), new Str("are"), new Str("ares"), new Str("ast"), new Str("asts"), new Str("aste"), new Str("astes"));}, _104: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_85", cs), new Int(2));}, _105: function(cs){return Editor.concretes["EditorSwe"].rule("_104", cs).sel(new Int(0));}, _107: function(cs){return Editor.concretes["EditorSwe"].rule("_104", cs).sel(new Int(1));}, _114: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_39", cs), new Int(1), new Int(0));}, _12: function(cs){return cs[0].sel(new Int(0));}, _126: function(cs){return new Arr(new Str("r"), new Str("s"), new Str(""), new Str("s"), new Str(""), new Str("s"), new Str("d"), new Str("ds"), new Str("t"), new Str("ts"), new Str("de"), new Str("des"), new Str("de"), new Str("des"), new Str("de"), new Str("des"));}, _129: function(cs){return new Arr(new Str("er"), new Str("s"), new Str(""), new Str("s"), new Str("a"), new Str("as"), new Str("t"), new Str("ts"), new Str("t"), new Str("ts"), new Str("ta"), new Str("tas"), new Str("ta"), new Str("tas"), new Str("ta"), new Str("tas"));}, _13: function(cs){return new Arr(new Int(2), new Int(3), new Int(2));}, _14: function(cs){return cs[0].sel(new Int(2));}, _140: function(cs){return new Arr(new Str("n"), new Str("t"));}, _141: function(cs){return new Suffix("de", Editor.concretes["EditorSwe"].rule("_140", cs));}, _142: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_141", cs), Editor.concretes["EditorSwe"].rule("_141", cs));}, _143: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_48", cs), Editor.concretes["EditorSwe"].rule("_48", cs));}, _144: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_141", cs), Editor.concretes["EditorSwe"].rule("_143", cs));}, _145: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_142", cs), Editor.concretes["EditorSwe"].rule("_144", cs));}, _146: function(cs){return new Arr(new Str(""), new Str(""));}, _147: function(cs){return new Suffix("de", Editor.concretes["EditorSwe"].rule("_146", cs));}, _148: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_147", cs), Editor.concretes["EditorSwe"].rule("_147", cs));}, _149: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_147", cs), Editor.concretes["EditorSwe"].rule("_143", cs));}, _15: function(cs){return Editor.concretes["EditorSwe"].rule("_13", cs).sel(Editor.concretes["EditorSwe"].rule("_14", cs));}, _150: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_148", cs), Editor.concretes["EditorSwe"].rule("_149", cs));}, _151: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_145", cs), Editor.concretes["EditorSwe"].rule("_150", cs));}, _152: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_151", cs), new Int(2));}, _16: function(cs){return Editor.concretes["EditorSwe"].rule("_12", cs).sel(Editor.concretes["EditorSwe"].rule("_15", cs));}, _168: function(cs){return Editor.concretes["EditorSwe"].rule("_12", cs).sel(new Int(0));}, _169: function(cs){return Editor.concretes["EditorSwe"].rule("_12", cs).sel(new Int(2));}, _17: function(cs){return cs[0].sel(new Int(1));}, _170: function(cs){return Editor.concretes["EditorSwe"].rule("_12", cs).sel(new Int(4));}, _171: function(cs){return Editor.concretes["EditorSwe"].rule("_12", cs).sel(new Int(6));}, _172: function(cs){return Editor.concretes["EditorSwe"].rule("_12", cs).sel(new Int(8));}, _173: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_168", cs), Editor.concretes["EditorSwe"].rule("_169", cs), Editor.concretes["EditorSwe"].rule("_170", cs), Editor.concretes["EditorSwe"].rule("_171", cs), Editor.concretes["EditorSwe"].rule("_172", cs));}, _174: function(cs){return Editor.concretes["EditorSwe"].rule("_76", cs).sel(Editor.concretes["EditorSwe"].rule("_39", cs));}, _175: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_174", cs), new Int(3), new Int(3));}, _176: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_174", cs), new Int(4), new Int(4));}, _177: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_175", cs), Editor.concretes["EditorSwe"].rule("_175", cs), Editor.concretes["EditorSwe"].rule("_176", cs));}, _178: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_39", cs), new Int(0));}, _179: function(cs){return Editor.concretes["EditorSwe"].rule("_178", cs).sel(new Int(0));}, _18: function(cs){return cs[1].sel(new Int(0));}, _180: function(cs){return Editor.concretes["EditorSwe"].rule("_52", cs).sel(Editor.concretes["EditorSwe"].rule("_179", cs));}, _181: function(cs){return Editor.concretes["EditorSwe"].rule("_178", cs).sel(new Int(1));}, _182: function(cs){return Editor.concretes["EditorSwe"].rule("_180", cs).sel(Editor.concretes["EditorSwe"].rule("_181", cs));}, _183: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_182", cs), new Int(0));}, _189: function(cs){return Editor.concretes["EditorSwe"].rule("_67", cs).sel(new Int(0));}, _19: function(cs){return Editor.concretes["EditorSwe"].rule("_18", cs).sel(new Int(0));}, _191: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_182", cs), new Int(1));}, _198: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_182", cs), new Int(2));}, _20: function(cs){return Editor.concretes["EditorSwe"].rule("_19", cs).sel(new Int(1));}, _207: function(cs){return new Arr(new Int(0), new Int(1), new Int(0));}, _21: function(cs){return Editor.concretes["EditorSwe"].rule("_20", cs).sel(new Int(1));}, _22: function(cs){return cs[2].sel(new Int(1));}, _225: function(cs){return new Suffix("flyttal", Editor.concretes["EditorSwe"].rule("_3", cs));}, _23: function(cs){return Editor.concretes["EditorSwe"].rule("_21", cs).sel(Editor.concretes["EditorSwe"].rule("_22", cs));}, _24: function(cs){return cs[2].sel(new Int(0));}, _248: function(cs){return new Arr(new Str("n"), new Str("tt"));}, _249: function(cs){return new Suffix("e", Editor.concretes["EditorSwe"].rule("_248", cs));}, _25: function(cs){return Editor.concretes["EditorSwe"].rule("_24", cs).sel(new Int(0));}, _250: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_143", cs), Editor.concretes["EditorSwe"].rule("_249", cs));}, _251: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_250", cs), Editor.concretes["EditorSwe"].rule("_250", cs));}, _252: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_143", cs), Editor.concretes["EditorSwe"].rule("_143", cs));}, _253: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_252", cs), Editor.concretes["EditorSwe"].rule("_252", cs));}, _254: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_251", cs), Editor.concretes["EditorSwe"].rule("_253", cs));}, _255: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_254", cs), new Int(0));}, _256: function(cs){return new Suffix("heltal", Editor.concretes["EditorSwe"].rule("_3", cs));}, _26: function(cs){return Editor.concretes["EditorSwe"].rule("_25", cs).sel(new Int(0));}, _27: function(cs){return Editor.concretes["EditorSwe"].rule("_26", cs).sel(new Int(0));}, _274: function(cs){return new Suffix("språk", Editor.concretes["EditorSwe"].rule("_3", cs));}, _28: function(cs){return Editor.concretes["EditorSwe"].rule("_25", cs).sel(new Int(1));}, _29: function(cs){return Editor.concretes["EditorSwe"].rule("_28", cs).sel(new Int(0));}, _3: function(cs){return new Arr(new Str(""), new Str("s"));}, _30: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_27", cs), Editor.concretes["EditorSwe"].rule("_27", cs), Editor.concretes["EditorSwe"].rule("_29", cs));}, _31: function(cs){return new Arr(new Int(0), new Int(0));}, _32: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_31", cs), Editor.concretes["EditorSwe"].rule("_31", cs));}, _33: function(cs){return new Arr(new Int(1), new Int(1));}, _34: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_33", cs), Editor.concretes["EditorSwe"].rule("_33", cs));}, _341: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_48", cs), Editor.concretes["EditorSwe"].rule("_48", cs), new Str("mig"));}, _342: function(cs){return Editor.concretes["EditorSwe"].rule("_341", cs).sel(Editor.concretes["EditorSwe"].rule("_14", cs));}, _343: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_48", cs), Editor.concretes["EditorSwe"].rule("_48", cs), new Str("sig"));}, _344: function(cs){return Editor.concretes["EditorSwe"].rule("_343", cs).sel(Editor.concretes["EditorSwe"].rule("_14", cs));}, _345: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_342", cs), Editor.concretes["EditorSwe"].rule("_64", cs), Editor.concretes["EditorSwe"].rule("_344", cs));}, _35: function(cs){return new Arr(new Int(1), new Int(2));}, _36: function(cs){return new Arr(new Int(2), new Int(2));}, _37: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_35", cs), Editor.concretes["EditorSwe"].rule("_36", cs));}, _38: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_32", cs), Editor.concretes["EditorSwe"].rule("_34", cs), Editor.concretes["EditorSwe"].rule("_37", cs));}, _382: function(cs){return new Suffix("träd", Editor.concretes["EditorSwe"].rule("_3", cs));}, _39: function(cs){return cs[1].sel(new Int(1));}, _40: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_39", cs), new Int(1), new Int(1));}, _401: function(cs){return new Arr(cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0], cs[0]);}, _403: function(cs){return new Arr(cs[0], cs[0]);}, _404: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_403", cs), Editor.concretes["EditorSwe"].rule("_403", cs));}, _405: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_404", cs), Editor.concretes["EditorSwe"].rule("_404", cs));}, _41: function(cs){return Editor.concretes["EditorSwe"].rule("_40", cs).sel(new Int(0));}, _42: function(cs){return Editor.concretes["EditorSwe"].rule("_38", cs).sel(Editor.concretes["EditorSwe"].rule("_41", cs));}, _43: function(cs){return Editor.concretes["EditorSwe"].rule("_40", cs).sel(new Int(1));}, _44: function(cs){return Editor.concretes["EditorSwe"].rule("_42", cs).sel(Editor.concretes["EditorSwe"].rule("_43", cs));}, _45: function(cs){return Editor.concretes["EditorSwe"].rule("_40", cs).sel(new Int(2));}, _46: function(cs){return Editor.concretes["EditorSwe"].rule("_44", cs).sel(Editor.concretes["EditorSwe"].rule("_45", cs));}, _47: function(cs){return Editor.concretes["EditorSwe"].rule("_30", cs).sel(Editor.concretes["EditorSwe"].rule("_46", cs));}, _48: function(cs){return new Seq();}, _49: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_48", cs), Editor.concretes["EditorSwe"].rule("_48", cs), Editor.concretes["EditorSwe"].rule("_48", cs));}, _50: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_49", cs), Editor.concretes["EditorSwe"].rule("_49", cs), Editor.concretes["EditorSwe"].rule("_49", cs));}, _51: function(cs){return new Arr(new Int(0), new Int(2));}, _52: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_51", cs), Editor.concretes["EditorSwe"].rule("_35", cs));}, _53: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_22", cs), new Int(0));}, _54: function(cs){return Editor.concretes["EditorSwe"].rule("_53", cs).sel(new Int(0));}, _55: function(cs){return Editor.concretes["EditorSwe"].rule("_52", cs).sel(Editor.concretes["EditorSwe"].rule("_54", cs));}, _56: function(cs){return Editor.concretes["EditorSwe"].rule("_53", cs).sel(new Int(1));}, _57: function(cs){return Editor.concretes["EditorSwe"].rule("_55", cs).sel(Editor.concretes["EditorSwe"].rule("_56", cs));}, _58: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_57", cs), new Int(2));}, _59: function(cs){return Editor.concretes["EditorSwe"].rule("_58", cs).sel(new Int(0));}, _60: function(cs){return Editor.concretes["EditorSwe"].rule("_50", cs).sel(Editor.concretes["EditorSwe"].rule("_59", cs));}, _61: function(cs){return Editor.concretes["EditorSwe"].rule("_58", cs).sel(new Int(1));}, _62: function(cs){return Editor.concretes["EditorSwe"].rule("_60", cs).sel(Editor.concretes["EditorSwe"].rule("_61", cs));}, _63: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_48", cs), Editor.concretes["EditorSwe"].rule("_48", cs), new Str("dig"));}, _64: function(cs){return Editor.concretes["EditorSwe"].rule("_63", cs).sel(Editor.concretes["EditorSwe"].rule("_14", cs));}, _67: function(cs){return Editor.concretes["EditorSwe"].rule("_19", cs).sel(new Int(0));}, _69: function(cs){return cs[3].sel(new Int(1));}, _71: function(cs){return Editor.concretes["EditorSwe"].rule("_24", cs).sel(new Int(2));}, _72: function(cs){return Editor.concretes["EditorSwe"].rule("_24", cs).sel(new Int(4));}, _73: function(cs){return Editor.concretes["EditorSwe"].rule("_24", cs).sel(new Int(6));}, _74: function(cs){return Editor.concretes["EditorSwe"].rule("_24", cs).sel(new Int(8));}, _75: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_25", cs), Editor.concretes["EditorSwe"].rule("_71", cs), Editor.concretes["EditorSwe"].rule("_72", cs), Editor.concretes["EditorSwe"].rule("_73", cs), Editor.concretes["EditorSwe"].rule("_74", cs));}, _76: function(cs){return new Arr(new Int(0), new Int(1));}, _77: function(cs){return Editor.concretes["EditorSwe"].rule("_76", cs).sel(Editor.concretes["EditorSwe"].rule("_69", cs));}, _78: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_77", cs), new Int(3), new Int(3));}, _79: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_77", cs), new Int(4), new Int(4));}, _80: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_78", cs), Editor.concretes["EditorSwe"].rule("_78", cs), Editor.concretes["EditorSwe"].rule("_79", cs));}, _81: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_69", cs), new Int(0));}, _82: function(cs){return Editor.concretes["EditorSwe"].rule("_81", cs).sel(new Int(0));}, _83: function(cs){return Editor.concretes["EditorSwe"].rule("_52", cs).sel(Editor.concretes["EditorSwe"].rule("_82", cs));}, _84: function(cs){return Editor.concretes["EditorSwe"].rule("_81", cs).sel(new Int(1));}, _85: function(cs){return Editor.concretes["EditorSwe"].rule("_83", cs).sel(Editor.concretes["EditorSwe"].rule("_84", cs));}, _86: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_85", cs), new Int(0));}, _92: function(cs){return cs[3].sel(new Int(0));}, _93: function(cs){return Editor.concretes["EditorSwe"].rule("_92", cs).sel(new Int(0));}, _94: function(cs){return Editor.concretes["EditorSwe"].rule("_93", cs).sel(new Int(0));}, _95: function(cs){return Editor.concretes["EditorSwe"].rule("_94", cs).sel(new Int(0));}, _97: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_85", cs), new Int(1));}, Adjective: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_401", cs), new Int(0));}, Determiner: function(cs){return new Arr(new Arr(Editor.concretes["EditorSwe"].rule("_405", cs), Editor.concretes["EditorSwe"].rule("_405", cs)), new Int(0));}, Noun: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_405", cs), new Int(0));}, Sentence: function(cs){return new Arr(cs[0]);}, Verb: function(cs){return new Arr(Editor.concretes["EditorSwe"].rule("_401", cs), cs[0], new Int(0));}, "Int": function(cs){return new Arr(cs[0]);}, "Float": function(cs){return new Arr(cs[0]);}, "String": function(cs){return new Arr(cs[0]);}}, new Parser("Sentence",[new Rule(27, new FunApp("Copy",[]),[],[[],[new Terminal("Kopiera")]]), new Rule(27, new FunApp("Cut",[]),[],[[new Terminal("ut")],[new Terminal("Klipp")]]), new Rule(27, new FunApp("Delete",[]),[],[[],[new Terminal("Radera")]]), new Rule(27, new FunApp("Enter",[]),[],[[],[new Terminal("Skriv")]]), new Rule(27, new FunApp("Parse",[]),[],[[],[new Terminal("Parsa")]]), new Rule(27, new FunApp("Paste",[]),[],[[new Terminal("in")],[new Terminal("Klistra")]]), new Rule(27, new FunApp("Redo",[]),[],[[],[new Terminal("Upprepa")]]), new Rule(27, new FunApp("Refine",[]),[],[[],[new Terminal("Raffinera")]]), new Rule(27, new FunApp("Replace",[]),[],[[],[new Terminal("Ersätt")]]), new Rule(27, new FunApp("Select",[]),[],[[],[new Terminal("Välj")]]), new Rule(27, new FunApp("Show",[]),[],[[],[new Terminal("Visa")]]), new Rule(27, new FunApp("Undo",[]),[],[[],[new Terminal("Ångra")]]), new Rule(27, new FunApp("Wrap",[]),[],[[],[new Terminal("Förpacka")]]), new Rule(24, new FunApp("Wrapper",[]),[],[[new Terminal("förpackning")]]), new Rule(23, new FunApp("Wrapper",[]),[],[[new Terminal("förpacknings")]]), new Rule(22, new FunApp("Wrapper",[]),[],[[new Terminal("förpackningen")]]), new Rule(21, new FunApp("Wrapper",[]),[],[[new Terminal("förpackningens")]]), new Rule(20, new FunApp("Wrapper",[]),[],[[new Terminal("förpackningar")]]), new Rule(19, new FunApp("Wrapper",[]),[],[[new Terminal("förpackningars")]]), new Rule(18, new FunApp("Wrapper",[]),[],[[new Terminal("förpackningarna")]]), new Rule(17, new FunApp("Wrapper",[]),[],[[new Terminal("förpackningarnas")]]), new Rule(65, new FunApp("Wrap",[]),[],[[new Terminal("Förpackar")]]), new Rule(64, new FunApp("Wrap",[]),[],[[new Terminal("Förpackas")]]), new Rule(63, new FunApp("Wrap",[]),[],[[new Terminal("Förpacka")]]), new Rule(62, new FunApp("Wrap",[]),[],[[new Terminal("Förpackas")]]), new Rule(61, new FunApp("Wrap",[]),[],[[new Terminal("Förpacka")]]), new Rule(60, new FunApp("Wrap",[]),[],[[new Terminal("Förpackas")]]), new Rule(59, new FunApp("Wrap",[]),[],[[new Terminal("Förpackad")]]), new Rule(58, new FunApp("Wrap",[]),[],[[new Terminal("Förpackads")]]), new Rule(57, new FunApp("Wrap",[]),[],[[new Terminal("Förpackat")]]), new Rule(56, new FunApp("Wrap",[]),[],[[new Terminal("Förpackats")]]), new Rule(55, new FunApp("Wrap",[]),[],[[new Terminal("Förpackade")]]), new Rule(54, new FunApp("Wrap",[]),[],[[new Terminal("Förpackades")]]), new Rule(53, new FunApp("Wrap",[]),[],[[new Terminal("Förpackade")]]), new Rule(52, new FunApp("Wrap",[]),[],[[new Terminal("Förpackades")]]), new Rule(51, new FunApp("Wrap",[]),[],[[new Terminal("Förpackade")]]), new Rule(50, new FunApp("Wrap",[]),[],[[new Terminal("Förpackades")]]), new Rule(49, new FunApp("Wrap",[]),[],[[]]), new Rule(65, new FunApp("Undo",[]),[],[[new Terminal("Ångrar")]]), new Rule(64, new FunApp("Undo",[]),[],[[new Terminal("Ångras")]]), new Rule(63, new FunApp("Undo",[]),[],[[new Terminal("Ångra")]]), new Rule(62, new FunApp("Undo",[]),[],[[new Terminal("Ångras")]]), new Rule(61, new FunApp("Undo",[]),[],[[new Terminal("Ångra")]]), new Rule(60, new FunApp("Undo",[]),[],[[new Terminal("Ångras")]]), new Rule(59, new FunApp("Undo",[]),[],[[new Terminal("Ångrad")]]), new Rule(58, new FunApp("Undo",[]),[],[[new Terminal("Ångrads")]]), new Rule(57, new FunApp("Undo",[]),[],[[new Terminal("Ångrat")]]), new Rule(56, new FunApp("Undo",[]),[],[[new Terminal("Ångrats")]]), new Rule(55, new FunApp("Undo",[]),[],[[new Terminal("Ångrade")]]), new Rule(54, new FunApp("Undo",[]),[],[[new Terminal("Ångrades")]]), new Rule(53, new FunApp("Undo",[]),[],[[new Terminal("Ångrade")]]), new Rule(52, new FunApp("Undo",[]),[],[[new Terminal("Ångrades")]]), new Rule(51, new FunApp("Undo",[]),[],[[new Terminal("Ångrade")]]), new Rule(50, new FunApp("Undo",[]),[],[[new Terminal("Ångrades")]]), new Rule(49, new FunApp("Undo",[]),[],[[]]), new Rule(30, new FunApp("Tree",[]),[],[[new Terminal("träd")]]), new Rule(83, new FunApp("Tree",[]),[],[[new Terminal("träds")]]), new Rule(33, new FunApp("Tree",[]),[],[[new Terminal("trädet")]]), new Rule(82, new FunApp("Tree",[]),[],[[new Terminal("trädets")]]), new Rule(81, new FunApp("Tree",[]),[],[[new Terminal("träd")]]), new Rule(80, new FunApp("Tree",[]),[],[[new Terminal("träds")]]), new Rule(79, new FunApp("Tree",[]),[],[[new Terminal("träden")]]), new Rule(78, new FunApp("Tree",[]),[],[[new Terminal("trädens")]]), new Rule(24, new FunApp("Swedish",[]),[],[[new Terminal("Svenska")]]), new Rule(23, new FunApp("Swedish",[]),[],[[new Terminal("Svenskas")]]), new Rule(22, new FunApp("Swedish",[]),[],[[new Terminal("Svenskan")]]), new Rule(21, new FunApp("Swedish",[]),[],[[new Terminal("Svenskans")]]), new Rule(20, new FunApp("Swedish",[]),[],[[new Terminal("Svenskor")]]), new Rule(19, new FunApp("Swedish",[]),[],[[new Terminal("Svenskors")]]), new Rule(18, new FunApp("Swedish",[]),[],[[new Terminal("Svenskorna")]]), new Rule(17, new FunApp("Swedish",[]),[],[[new Terminal("Svenskornas")]]), new Rule(24, new FunApp("String_N",[]),[],[[new Terminal("sträng")]]), new Rule(23, new FunApp("String_N",[]),[],[[new Terminal("strängs")]]), new Rule(22, new FunApp("String_N",[]),[],[[new Terminal("strängen")]]), new Rule(21, new FunApp("String_N",[]),[],[[new Terminal("strängens")]]), new Rule(20, new FunApp("String_N",[]),[],[[new Terminal("strängar")]]), new Rule(19, new FunApp("String_N",[]),[],[[new Terminal("strängars")]]), new Rule(18, new FunApp("String_N",[]),[],[[new Terminal("strängarna")]]), new Rule(17, new FunApp("String_N",[]),[],[[new Terminal("strängarnas")]]), new Rule(24, new FunApp("Spanish",[]),[],[[new Terminal("Spanska")]]), new Rule(23, new FunApp("Spanish",[]),[],[[new Terminal("Spanskas")]]), new Rule(22, new FunApp("Spanish",[]),[],[[new Terminal("Spanskan")]]), new Rule(21, new FunApp("Spanish",[]),[],[[new Terminal("Spanskans")]]), new Rule(20, new FunApp("Spanish",[]),[],[[new Terminal("Spanskor")]]), new Rule(19, new FunApp("Spanish",[]),[],[[new Terminal("Spanskors")]]), new Rule(18, new FunApp("Spanish",[]),[],[[new Terminal("Spanskorna")]]), new Rule(17, new FunApp("Spanish",[]),[],[[new Terminal("Spanskornas")]]), new Rule(25, new FunApp("SingleWordCommand",[new Arg(0)]),[36],[[new ArgProj(0, 1), new ArgProj(0, 0), new Terminal("dig")]]), new Rule(25, new FunApp("SingleWordCommand",[new Arg(0)]),[35],[[new ArgProj(0, 1), new ArgProj(0, 0)]]), new Rule(25, new FunApp("SingleWordCommand",[new Arg(0)]),[27],[[new ArgProj(0, 1), new ArgProj(0, 0)]]), new Rule(65, new FunApp("Show",[]),[],[[new Terminal("Visar")]]), new Rule(64, new FunApp("Show",[]),[],[[new Terminal("Visas")]]), new Rule(63, new FunApp("Show",[]),[],[[new Terminal("Visa")]]), new Rule(62, new FunApp("Show",[]),[],[[new Terminal("Visas")]]), new Rule(61, new FunApp("Show",[]),[],[[new Terminal("Visa")]]), new Rule(60, new FunApp("Show",[]),[],[[new Terminal("Visas")]]), new Rule(59, new FunApp("Show",[]),[],[[new Terminal("Visad")]]), new Rule(58, new FunApp("Show",[]),[],[[new Terminal("Visads")]]), new Rule(57, new FunApp("Show",[]),[],[[new Terminal("Visat")]]), new Rule(56, new FunApp("Show",[]),[],[[new Terminal("Visats")]]), new Rule(55, new FunApp("Show",[]),[],[[new Terminal("Visade")]]), new Rule(54, new FunApp("Show",[]),[],[[new Terminal("Visades")]]), new Rule(53, new FunApp("Show",[]),[],[[new Terminal("Visade")]]), new Rule(52, new FunApp("Show",[]),[],[[new Terminal("Visades")]]), new Rule(51, new FunApp("Show",[]),[],[[new Terminal("Visade")]]), new Rule(50, new FunApp("Show",[]),[],[[new Terminal("Visades")]]), new Rule(49, new FunApp("Show",[]),[],[[]]), new Rule(65, new FunApp("Select",[]),[],[[new Terminal("Väljer")]]), new Rule(64, new FunApp("Select",[]),[],[[new Terminal("Väljs")]]), new Rule(63, new FunApp("Select",[]),[],[[new Terminal("Välj")]]), new Rule(62, new FunApp("Select",[]),[],[[new Terminal("Väljs")]]), new Rule(61, new FunApp("Select",[]),[],[[new Terminal("Välja")]]), new Rule(60, new FunApp("Select",[]),[],[[new Terminal("Väljas")]]), new Rule(59, new FunApp("Select",[]),[],[[new Terminal("Väljt")]]), new Rule(58, new FunApp("Select",[]),[],[[new Terminal("Väljts")]]), new Rule(57, new FunApp("Select",[]),[],[[new Terminal("Väljt")]]), new Rule(56, new FunApp("Select",[]),[],[[new Terminal("Väljts")]]), new Rule(55, new FunApp("Select",[]),[],[[new Terminal("Väljta")]]), new Rule(54, new FunApp("Select",[]),[],[[new Terminal("Väljtas")]]), new Rule(53, new FunApp("Select",[]),[],[[new Terminal("Väljta")]]), new Rule(52, new FunApp("Select",[]),[],[[new Terminal("Väljtas")]]), new Rule(51, new FunApp("Select",[]),[],[[new Terminal("Väljta")]]), new Rule(50, new FunApp("Select",[]),[],[[new Terminal("Väljtas")]]), new Rule(49, new FunApp("Select",[]),[],[[]]), new Rule(24, new FunApp("Russian",[]),[],[[new Terminal("Ryska")]]), new Rule(23, new FunApp("Russian",[]),[],[[new Terminal("Ryskas")]]), new Rule(22, new FunApp("Russian",[]),[],[[new Terminal("Ryskan")]]), new Rule(21, new FunApp("Russian",[]),[],[[new Terminal("Ryskans")]]), new Rule(20, new FunApp("Russian",[]),[],[[new Terminal("Ryskor")]]), new Rule(19, new FunApp("Russian",[]),[],[[new Terminal("Ryskors")]]), new Rule(18, new FunApp("Russian",[]),[],[[new Terminal("Ryskorna")]]), new Rule(17, new FunApp("Russian",[]),[],[[new Terminal("Ryskornas")]]), new Rule(65, new FunApp("Replace",[]),[],[[new Terminal("Ersätter")]]), new Rule(64, new FunApp("Replace",[]),[],[[new Terminal("Ersätts")]]), new Rule(63, new FunApp("Replace",[]),[],[[new Terminal("Ersätt")]]), new Rule(62, new FunApp("Replace",[]),[],[[new Terminal("Ersätts")]]), new Rule(61, new FunApp("Replace",[]),[],[[new Terminal("Ersätta")]]), new Rule(60, new FunApp("Replace",[]),[],[[new Terminal("Ersättas")]]), new Rule(59, new FunApp("Replace",[]),[],[[new Terminal("Ersättt")]]), new Rule(58, new FunApp("Replace",[]),[],[[new Terminal("Ersättts")]]), new Rule(57, new FunApp("Replace",[]),[],[[new Terminal("Ersättt")]]), new Rule(56, new FunApp("Replace",[]),[],[[new Terminal("Ersättts")]]), new Rule(55, new FunApp("Replace",[]),[],[[new Terminal("Ersättta")]]), new Rule(54, new FunApp("Replace",[]),[],[[new Terminal("Ersätttas")]]), new Rule(53, new FunApp("Replace",[]),[],[[new Terminal("Ersättta")]]), new Rule(52, new FunApp("Replace",[]),[],[[new Terminal("Ersätttas")]]), new Rule(51, new FunApp("Replace",[]),[],[[new Terminal("Ersättta")]]), new Rule(50, new FunApp("Replace",[]),[],[[new Terminal("Ersätttas")]]), new Rule(49, new FunApp("Replace",[]),[],[[]]), new Rule(24, new FunApp("Refinement",[]),[],[[new Terminal("raffinemang")]]), new Rule(23, new FunApp("Refinement",[]),[],[[new Terminal("raffinemangs")]]), new Rule(22, new FunApp("Refinement",[]),[],[[new Terminal("raffinemangen")]]), new Rule(21, new FunApp("Refinement",[]),[],[[new Terminal("raffinemangens")]]), new Rule(20, new FunApp("Refinement",[]),[],[[new Terminal("raffinemangar")]]), new Rule(19, new FunApp("Refinement",[]),[],[[new Terminal("raffinemangars")]]), new Rule(18, new FunApp("Refinement",[]),[],[[new Terminal("raffinemangarna")]]), new Rule(17, new FunApp("Refinement",[]),[],[[new Terminal("raffinemangarnas")]]), new Rule(65, new FunApp("Refine",[]),[],[[new Terminal("Raffinerar")]]), new Rule(64, new FunApp("Refine",[]),[],[[new Terminal("Raffineras")]]), new Rule(63, new FunApp("Refine",[]),[],[[new Terminal("Raffinera")]]), new Rule(62, new FunApp("Refine",[]),[],[[new Terminal("Raffineras")]]), new Rule(61, new FunApp("Refine",[]),[],[[new Terminal("Raffinera")]]), new Rule(60, new FunApp("Refine",[]),[],[[new Terminal("Raffineras")]]), new Rule(59, new FunApp("Refine",[]),[],[[new Terminal("Raffinerad")]]), new Rule(58, new FunApp("Refine",[]),[],[[new Terminal("Raffinerads")]]), new Rule(57, new FunApp("Refine",[]),[],[[new Terminal("Raffinerat")]]), new Rule(56, new FunApp("Refine",[]),[],[[new Terminal("Raffinerats")]]), new Rule(55, new FunApp("Refine",[]),[],[[new Terminal("Raffinerade")]]), new Rule(54, new FunApp("Refine",[]),[],[[new Terminal("Raffinerades")]]), new Rule(53, new FunApp("Refine",[]),[],[[new Terminal("Raffinerade")]]), new Rule(52, new FunApp("Refine",[]),[],[[new Terminal("Raffinerades")]]), new Rule(51, new FunApp("Refine",[]),[],[[new Terminal("Raffinerade")]]), new Rule(50, new FunApp("Refine",[]),[],[[new Terminal("Raffinerades")]]), new Rule(49, new FunApp("Refine",[]),[],[[]]), new Rule(65, new FunApp("Redo",[]),[],[[new Terminal("Upprepar")]]), new Rule(64, new FunApp("Redo",[]),[],[[new Terminal("Upprepas")]]), new Rule(63, new FunApp("Redo",[]),[],[[new Terminal("Upprepa")]]), new Rule(62, new FunApp("Redo",[]),[],[[new Terminal("Upprepas")]]), new Rule(61, new FunApp("Redo",[]),[],[[new Terminal("Upprepa")]]), new Rule(60, new FunApp("Redo",[]),[],[[new Terminal("Upprepas")]]), new Rule(59, new FunApp("Redo",[]),[],[[new Terminal("Upprepad")]]), new Rule(58, new FunApp("Redo",[]),[],[[new Terminal("Upprepads")]]), new Rule(57, new FunApp("Redo",[]),[],[[new Terminal("Upprepat")]]), new Rule(56, new FunApp("Redo",[]),[],[[new Terminal("Upprepats")]]), new Rule(55, new FunApp("Redo",[]),[],[[new Terminal("Upprepade")]]), new Rule(54, new FunApp("Redo",[]),[],[[new Terminal("Upprepades")]]), new Rule(53, new FunApp("Redo",[]),[],[[new Terminal("Upprepade")]]), new Rule(52, new FunApp("Redo",[]),[],[[new Terminal("Upprepades")]]), new Rule(51, new FunApp("Redo",[]),[],[[new Terminal("Upprepade")]]), new Rule(50, new FunApp("Redo",[]),[],[[new Terminal("Upprepades")]]), new Rule(49, new FunApp("Redo",[]),[],[[]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[36, 34, 33],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("dig"), new Terminal("slumpmässigt")]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[36, 32, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("dig"), new Terminal("slumpmässigt")]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[36, 31, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("dig"), new Terminal("slumpmässigt")]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[36, 29, 22],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("dig"), new Terminal("slumpmässigt")]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[36, 28, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("dig"), new Terminal("slumpmässigt")]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[36, 26, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("dig"), new Terminal("slumpmässigt")]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[35, 34, 33],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("slumpmässigt")]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[35, 32, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("slumpmässigt")]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[35, 31, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("slumpmässigt")]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[35, 29, 22],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("slumpmässigt")]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[35, 28, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("slumpmässigt")]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[35, 26, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("slumpmässigt")]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[27, 34, 33],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("slumpmässigt")]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[27, 32, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("slumpmässigt")]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[27, 31, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("slumpmässigt")]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[27, 29, 22],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("slumpmässigt")]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[27, 28, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("slumpmässigt")]]), new Rule(25, new FunApp("RandomlyCommand",[new Arg(0), new Arg(1), new Arg(2)]),[27, 26, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("slumpmässigt")]]), new Rule(16, new FunApp("Previous",[]),[],[[new Terminal("föregående")]]), new Rule(15, new FunApp("Previous",[]),[],[[new Terminal("föregåendes")]]), new Rule(14, new FunApp("Previous",[]),[],[[new Terminal("föregående")]]), new Rule(13, new FunApp("Previous",[]),[],[[new Terminal("föregåendes")]]), new Rule(12, new FunApp("Previous",[]),[],[[new Terminal("föregående")]]), new Rule(11, new FunApp("Previous",[]),[],[[new Terminal("föregåendes")]]), new Rule(10, new FunApp("Previous",[]),[],[[new Terminal("föregående")]]), new Rule(9, new FunApp("Previous",[]),[],[[new Terminal("föregåendes")]]), new Rule(8, new FunApp("Previous",[]),[],[[new Terminal("föregående")]]), new Rule(7, new FunApp("Previous",[]),[],[[new Terminal("föregåendes")]]), new Rule(6, new FunApp("Previous",[]),[],[[]]), new Rule(5, new FunApp("Previous",[]),[],[[new Terminal("s")]]), new Rule(4, new FunApp("Previous",[]),[],[[]]), new Rule(3, new FunApp("Previous",[]),[],[[new Terminal("s")]]), new Rule(2, new FunApp("Previous",[]),[],[[new Terminal("a")]]), new Rule(1, new FunApp("Previous",[]),[],[[new Terminal("as")]]), new Rule(65, new FunApp("Paste",[]),[],[[new Terminal("Klistrar")]]), new Rule(64, new FunApp("Paste",[]),[],[[new Terminal("Klistras")]]), new Rule(63, new FunApp("Paste",[]),[],[[new Terminal("Klistra")]]), new Rule(62, new FunApp("Paste",[]),[],[[new Terminal("Klistras")]]), new Rule(61, new FunApp("Paste",[]),[],[[new Terminal("Klistra")]]), new Rule(60, new FunApp("Paste",[]),[],[[new Terminal("Klistras")]]), new Rule(59, new FunApp("Paste",[]),[],[[new Terminal("Klistrad")]]), new Rule(58, new FunApp("Paste",[]),[],[[new Terminal("Klistrads")]]), new Rule(57, new FunApp("Paste",[]),[],[[new Terminal("Klistrat")]]), new Rule(56, new FunApp("Paste",[]),[],[[new Terminal("Klistrats")]]), new Rule(55, new FunApp("Paste",[]),[],[[new Terminal("Klistrade")]]), new Rule(54, new FunApp("Paste",[]),[],[[new Terminal("Klistrades")]]), new Rule(53, new FunApp("Paste",[]),[],[[new Terminal("Klistrade")]]), new Rule(52, new FunApp("Paste",[]),[],[[new Terminal("Klistrades")]]), new Rule(51, new FunApp("Paste",[]),[],[[new Terminal("Klistrade")]]), new Rule(50, new FunApp("Paste",[]),[],[[new Terminal("Klistrades")]]), new Rule(49, new FunApp("Paste",[]),[],[[new Terminal("in")]]), new Rule(65, new FunApp("Parse",[]),[],[[new Terminal("Parsar")]]), new Rule(64, new FunApp("Parse",[]),[],[[new Terminal("Parsas")]]), new Rule(63, new FunApp("Parse",[]),[],[[new Terminal("Parsa")]]), new Rule(62, new FunApp("Parse",[]),[],[[new Terminal("Parsas")]]), new Rule(61, new FunApp("Parse",[]),[],[[new Terminal("Parsa")]]), new Rule(60, new FunApp("Parse",[]),[],[[new Terminal("Parsas")]]), new Rule(59, new FunApp("Parse",[]),[],[[new Terminal("Parsad")]]), new Rule(58, new FunApp("Parse",[]),[],[[new Terminal("Parsads")]]), new Rule(57, new FunApp("Parse",[]),[],[[new Terminal("Parsat")]]), new Rule(56, new FunApp("Parse",[]),[],[[new Terminal("Parsats")]]), new Rule(55, new FunApp("Parse",[]),[],[[new Terminal("Parsade")]]), new Rule(54, new FunApp("Parse",[]),[],[[new Terminal("Parsades")]]), new Rule(53, new FunApp("Parse",[]),[],[[new Terminal("Parsade")]]), new Rule(52, new FunApp("Parse",[]),[],[[new Terminal("Parsades")]]), new Rule(51, new FunApp("Parse",[]),[],[[new Terminal("Parsade")]]), new Rule(50, new FunApp("Parse",[]),[],[[new Terminal("Parsades")]]), new Rule(49, new FunApp("Parse",[]),[],[[]]), new Rule(24, new FunApp("Page",[]),[],[[new Terminal("sida")]]), new Rule(23, new FunApp("Page",[]),[],[[new Terminal("sidas")]]), new Rule(22, new FunApp("Page",[]),[],[[new Terminal("sidan")]]), new Rule(21, new FunApp("Page",[]),[],[[new Terminal("sidans")]]), new Rule(20, new FunApp("Page",[]),[],[[new Terminal("sidor")]]), new Rule(19, new FunApp("Page",[]),[],[[new Terminal("sidors")]]), new Rule(18, new FunApp("Page",[]),[],[[new Terminal("sidorna")]]), new Rule(17, new FunApp("Page",[]),[],[[new Terminal("sidornas")]]), new Rule(24, new FunApp("Norwegian",[]),[],[[new Terminal("Norska")]]), new Rule(23, new FunApp("Norwegian",[]),[],[[new Terminal("Norskas")]]), new Rule(22, new FunApp("Norwegian",[]),[],[[new Terminal("Norskan")]]), new Rule(21, new FunApp("Norwegian",[]),[],[[new Terminal("Norskans")]]), new Rule(20, new FunApp("Norwegian",[]),[],[[new Terminal("Norskor")]]), new Rule(19, new FunApp("Norwegian",[]),[],[[new Terminal("Norskors")]]), new Rule(18, new FunApp("Norwegian",[]),[],[[new Terminal("Norskorna")]]), new Rule(17, new FunApp("Norwegian",[]),[],[[new Terminal("Norskornas")]]), new Rule(24, new FunApp("Node",[]),[],[[new Terminal("nod")]]), new Rule(23, new FunApp("Node",[]),[],[[new Terminal("nods")]]), new Rule(22, new FunApp("Node",[]),[],[[new Terminal("noden")]]), new Rule(21, new FunApp("Node",[]),[],[[new Terminal("nodens")]]), new Rule(20, new FunApp("Node",[]),[],[[new Terminal("nodar")]]), new Rule(19, new FunApp("Node",[]),[],[[new Terminal("nodars")]]), new Rule(18, new FunApp("Node",[]),[],[[new Terminal("nodarna")]]), new Rule(17, new FunApp("Node",[]),[],[[new Terminal("nodarnas")]]), new Rule(16, new FunApp("Next",[]),[],[[new Terminal("näst")]]), new Rule(15, new FunApp("Next",[]),[],[[new Terminal("nästs")]]), new Rule(14, new FunApp("Next",[]),[],[[new Terminal("nästt")]]), new Rule(13, new FunApp("Next",[]),[],[[new Terminal("nästts")]]), new Rule(12, new FunApp("Next",[]),[],[[new Terminal("nästa")]]), new Rule(11, new FunApp("Next",[]),[],[[new Terminal("nästas")]]), new Rule(10, new FunApp("Next",[]),[],[[new Terminal("nästa")]]), new Rule(9, new FunApp("Next",[]),[],[[new Terminal("nästas")]]), new Rule(8, new FunApp("Next",[]),[],[[new Terminal("nästa")]]), new Rule(7, new FunApp("Next",[]),[],[[new Terminal("nästas")]]), new Rule(6, new FunApp("Next",[]),[],[[new Terminal("nästare")]]), new Rule(5, new FunApp("Next",[]),[],[[new Terminal("nästares")]]), new Rule(4, new FunApp("Next",[]),[],[[new Terminal("nästast")]]), new Rule(3, new FunApp("Next",[]),[],[[new Terminal("nästasts")]]), new Rule(2, new FunApp("Next",[]),[],[[new Terminal("nästaste")]]), new Rule(1, new FunApp("Next",[]),[],[[new Terminal("nästastes")]]), new Rule(30, new FunApp("Language",[]),[],[[new Terminal("språk")]]), new Rule(83, new FunApp("Language",[]),[],[[new Terminal("språks")]]), new Rule(33, new FunApp("Language",[]),[],[[new Terminal("språket")]]), new Rule(82, new FunApp("Language",[]),[],[[new Terminal("språkets")]]), new Rule(81, new FunApp("Language",[]),[],[[new Terminal("språk")]]), new Rule(80, new FunApp("Language",[]),[],[[new Terminal("språks")]]), new Rule(79, new FunApp("Language",[]),[],[[new Terminal("språken")]]), new Rule(78, new FunApp("Language",[]),[],[[new Terminal("språkens")]]), new Rule(25, new FunApp("Label",[new Arg(0)]),[96],[[new ArgProj(0, 0)]]), new Rule(96, new Arg(0),[30],[[new ArgProj(0, 0)]]), new Rule(96, new Arg(0),[24],[[new ArgProj(0, 0)]]), new Rule(24, new FunApp("Italian",[]),[],[[new Terminal("Italienska")]]), new Rule(23, new FunApp("Italian",[]),[],[[new Terminal("Italienskas")]]), new Rule(22, new FunApp("Italian",[]),[],[[new Terminal("Italienskan")]]), new Rule(21, new FunApp("Italian",[]),[],[[new Terminal("Italienskans")]]), new Rule(20, new FunApp("Italian",[]),[],[[new Terminal("Italienskor")]]), new Rule(19, new FunApp("Italian",[]),[],[[new Terminal("Italienskors")]]), new Rule(18, new FunApp("Italian",[]),[],[[new Terminal("Italienskorna")]]), new Rule(17, new FunApp("Italian",[]),[],[[new Terminal("Italienskornas")]]), new Rule(30, new FunApp("Integer_N",[]),[],[[new Terminal("heltal")]]), new Rule(83, new FunApp("Integer_N",[]),[],[[new Terminal("heltals")]]), new Rule(33, new FunApp("Integer_N",[]),[],[[new Terminal("heltalet")]]), new Rule(82, new FunApp("Integer_N",[]),[],[[new Terminal("heltalets")]]), new Rule(81, new FunApp("Integer_N",[]),[],[[new Terminal("heltal")]]), new Rule(80, new FunApp("Integer_N",[]),[],[[new Terminal("heltals")]]), new Rule(79, new FunApp("Integer_N",[]),[],[[new Terminal("heltalen")]]), new Rule(78, new FunApp("Integer_N",[]),[],[[new Terminal("heltalens")]]), new Rule(95, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(94, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(39, new FunApp("IndefSgDet",[]),[],[[new Terminal("en")]]), new Rule(46, new FunApp("IndefSgDet",[]),[],[[new Terminal("ett")]]), new Rule(93, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(92, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(26, new FunApp("IndefSgDet",[]),[],[[new Terminal("en")]]), new Rule(31, new FunApp("IndefSgDet",[]),[],[[new Terminal("ett")]]), new Rule(91, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(90, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(89, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(88, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(87, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(86, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(85, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(84, new FunApp("IndefSgDet",[]),[],[[]]), new Rule(95, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(94, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(39, new FunApp("IndefPlDet",[]),[],[[new Terminal("en")]]), new Rule(46, new FunApp("IndefPlDet",[]),[],[[new Terminal("ett")]]), new Rule(93, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(92, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(26, new FunApp("IndefPlDet",[]),[],[[new Terminal("en")]]), new Rule(31, new FunApp("IndefPlDet",[]),[],[[new Terminal("ett")]]), new Rule(91, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(90, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(89, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(88, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(87, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(86, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(85, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(84, new FunApp("IndefPlDet",[]),[],[[]]), new Rule(24, new FunApp("German",[]),[],[[new Terminal("Tyska")]]), new Rule(23, new FunApp("German",[]),[],[[new Terminal("Tyskas")]]), new Rule(22, new FunApp("German",[]),[],[[new Terminal("Tyskan")]]), new Rule(21, new FunApp("German",[]),[],[[new Terminal("Tyskans")]]), new Rule(20, new FunApp("German",[]),[],[[new Terminal("Tyskor")]]), new Rule(19, new FunApp("German",[]),[],[[new Terminal("Tyskors")]]), new Rule(18, new FunApp("German",[]),[],[[new Terminal("Tyskorna")]]), new Rule(17, new FunApp("German",[]),[],[[new Terminal("Tyskornas")]]), new Rule(24, new FunApp("French",[]),[],[[new Terminal("Franska")]]), new Rule(23, new FunApp("French",[]),[],[[new Terminal("Franskas")]]), new Rule(22, new FunApp("French",[]),[],[[new Terminal("Franskan")]]), new Rule(21, new FunApp("French",[]),[],[[new Terminal("Franskans")]]), new Rule(20, new FunApp("French",[]),[],[[new Terminal("Franskor")]]), new Rule(19, new FunApp("French",[]),[],[[new Terminal("Franskors")]]), new Rule(18, new FunApp("French",[]),[],[[new Terminal("Franskorna")]]), new Rule(17, new FunApp("French",[]),[],[[new Terminal("Franskornas")]]), new Rule(30, new FunApp("Float_N",[]),[],[[new Terminal("flyttal")]]), new Rule(83, new FunApp("Float_N",[]),[],[[new Terminal("flyttals")]]), new Rule(33, new FunApp("Float_N",[]),[],[[new Terminal("flyttalet")]]), new Rule(82, new FunApp("Float_N",[]),[],[[new Terminal("flyttalets")]]), new Rule(81, new FunApp("Float_N",[]),[],[[new Terminal("flyttal")]]), new Rule(80, new FunApp("Float_N",[]),[],[[new Terminal("flyttals")]]), new Rule(79, new FunApp("Float_N",[]),[],[[new Terminal("flyttalen")]]), new Rule(78, new FunApp("Float_N",[]),[],[[new Terminal("flyttalens")]]), new Rule(24, new FunApp("Finnish",[]),[],[[new Terminal("Finska")]]), new Rule(23, new FunApp("Finnish",[]),[],[[new Terminal("Finskas")]]), new Rule(22, new FunApp("Finnish",[]),[],[[new Terminal("Finskan")]]), new Rule(21, new FunApp("Finnish",[]),[],[[new Terminal("Finskans")]]), new Rule(20, new FunApp("Finnish",[]),[],[[new Terminal("Finskor")]]), new Rule(19, new FunApp("Finnish",[]),[],[[new Terminal("Finskors")]]), new Rule(18, new FunApp("Finnish",[]),[],[[new Terminal("Finskorna")]]), new Rule(17, new FunApp("Finnish",[]),[],[[new Terminal("Finskornas")]]), new Rule(25, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[44, 30],[[new Terminal("det"), new Terminal("finns"), new Terminal("inte"), new Terminal("ett"), new ArgProj(0, 0), new ArgProj(1, 0)]]), new Rule(25, new FunApp("ErrorMessage",[new Arg(0), new Arg(1)]),[37, 24],[[new Terminal("det"), new Terminal("finns"), new Terminal("inte"), new Terminal("en"), new ArgProj(0, 0), new ArgProj(1, 0)]]), new Rule(65, new FunApp("Enter",[]),[],[[new Terminal("Skriver")]]), new Rule(64, new FunApp("Enter",[]),[],[[new Terminal("Skrivs")]]), new Rule(63, new FunApp("Enter",[]),[],[[new Terminal("Skriv")]]), new Rule(62, new FunApp("Enter",[]),[],[[new Terminal("Skrivs")]]), new Rule(61, new FunApp("Enter",[]),[],[[new Terminal("Skriva")]]), new Rule(60, new FunApp("Enter",[]),[],[[new Terminal("Skrivas")]]), new Rule(59, new FunApp("Enter",[]),[],[[new Terminal("Skrivd")]]), new Rule(58, new FunApp("Enter",[]),[],[[new Terminal("Skrivds")]]), new Rule(57, new FunApp("Enter",[]),[],[[new Terminal("Skrivt")]]), new Rule(56, new FunApp("Enter",[]),[],[[new Terminal("Skrivts")]]), new Rule(55, new FunApp("Enter",[]),[],[[new Terminal("Skrivda")]]), new Rule(54, new FunApp("Enter",[]),[],[[new Terminal("Skrivdas")]]), new Rule(53, new FunApp("Enter",[]),[],[[new Terminal("Skrivda")]]), new Rule(52, new FunApp("Enter",[]),[],[[new Terminal("Skrivdas")]]), new Rule(51, new FunApp("Enter",[]),[],[[new Terminal("Skrivda")]]), new Rule(50, new FunApp("Enter",[]),[],[[new Terminal("Skrivdas")]]), new Rule(49, new FunApp("Enter",[]),[],[[]]), new Rule(24, new FunApp("English",[]),[],[[new Terminal("Engelska")]]), new Rule(23, new FunApp("English",[]),[],[[new Terminal("Engelskas")]]), new Rule(22, new FunApp("English",[]),[],[[new Terminal("Engelskan")]]), new Rule(21, new FunApp("English",[]),[],[[new Terminal("Engelskans")]]), new Rule(20, new FunApp("English",[]),[],[[new Terminal("Engelskor")]]), new Rule(19, new FunApp("English",[]),[],[[new Terminal("Engelskors")]]), new Rule(18, new FunApp("English",[]),[],[[new Terminal("Engelskorna")]]), new Rule(17, new FunApp("English",[]),[],[[new Terminal("Engelskornas")]]), new Rule(65, new FunApp("Delete",[]),[],[[new Terminal("Raderar")]]), new Rule(64, new FunApp("Delete",[]),[],[[new Terminal("Raderas")]]), new Rule(63, new FunApp("Delete",[]),[],[[new Terminal("Radera")]]), new Rule(62, new FunApp("Delete",[]),[],[[new Terminal("Raderas")]]), new Rule(61, new FunApp("Delete",[]),[],[[new Terminal("Radera")]]), new Rule(60, new FunApp("Delete",[]),[],[[new Terminal("Raderas")]]), new Rule(59, new FunApp("Delete",[]),[],[[new Terminal("Raderad")]]), new Rule(58, new FunApp("Delete",[]),[],[[new Terminal("Raderads")]]), new Rule(57, new FunApp("Delete",[]),[],[[new Terminal("Raderat")]]), new Rule(56, new FunApp("Delete",[]),[],[[new Terminal("Raderats")]]), new Rule(55, new FunApp("Delete",[]),[],[[new Terminal("Raderade")]]), new Rule(54, new FunApp("Delete",[]),[],[[new Terminal("Raderades")]]), new Rule(53, new FunApp("Delete",[]),[],[[new Terminal("Raderade")]]), new Rule(52, new FunApp("Delete",[]),[],[[new Terminal("Raderades")]]), new Rule(51, new FunApp("Delete",[]),[],[[new Terminal("Raderade")]]), new Rule(50, new FunApp("Delete",[]),[],[[new Terminal("Raderades")]]), new Rule(49, new FunApp("Delete",[]),[],[[]]), new Rule(77, new FunApp("DefSgDet",[]),[],[[new Terminal("den")]]), new Rule(76, new FunApp("DefSgDet",[]),[],[[new Terminal("det")]]), new Rule(43, new FunApp("DefSgDet",[]),[],[[new Terminal("den")]]), new Rule(48, new FunApp("DefSgDet",[]),[],[[new Terminal("det")]]), new Rule(75, new FunApp("DefSgDet",[]),[],[[new Terminal("den")]]), new Rule(74, new FunApp("DefSgDet",[]),[],[[new Terminal("det")]]), new Rule(29, new FunApp("DefSgDet",[]),[],[[]]), new Rule(34, new FunApp("DefSgDet",[]),[],[[]]), new Rule(73, new FunApp("DefSgDet",[]),[],[[new Terminal("de")]]), new Rule(72, new FunApp("DefSgDet",[]),[],[[new Terminal("de")]]), new Rule(71, new FunApp("DefSgDet",[]),[],[[new Terminal("de")]]), new Rule(70, new FunApp("DefSgDet",[]),[],[[new Terminal("de")]]), new Rule(69, new FunApp("DefSgDet",[]),[],[[new Terminal("de")]]), new Rule(68, new FunApp("DefSgDet",[]),[],[[new Terminal("de")]]), new Rule(67, new FunApp("DefSgDet",[]),[],[[]]), new Rule(66, new FunApp("DefSgDet",[]),[],[[]]), new Rule(77, new FunApp("DefPlDet",[]),[],[[new Terminal("den")]]), new Rule(76, new FunApp("DefPlDet",[]),[],[[new Terminal("det")]]), new Rule(43, new FunApp("DefPlDet",[]),[],[[new Terminal("den")]]), new Rule(48, new FunApp("DefPlDet",[]),[],[[new Terminal("det")]]), new Rule(75, new FunApp("DefPlDet",[]),[],[[new Terminal("den")]]), new Rule(74, new FunApp("DefPlDet",[]),[],[[new Terminal("det")]]), new Rule(29, new FunApp("DefPlDet",[]),[],[[]]), new Rule(34, new FunApp("DefPlDet",[]),[],[[]]), new Rule(73, new FunApp("DefPlDet",[]),[],[[new Terminal("de")]]), new Rule(72, new FunApp("DefPlDet",[]),[],[[new Terminal("de")]]), new Rule(71, new FunApp("DefPlDet",[]),[],[[new Terminal("de")]]), new Rule(70, new FunApp("DefPlDet",[]),[],[[new Terminal("de")]]), new Rule(69, new FunApp("DefPlDet",[]),[],[[new Terminal("de")]]), new Rule(68, new FunApp("DefPlDet",[]),[],[[new Terminal("de")]]), new Rule(67, new FunApp("DefPlDet",[]),[],[[]]), new Rule(66, new FunApp("DefPlDet",[]),[],[[]]), new Rule(24, new FunApp("Danish",[]),[],[[new Terminal("Danska")]]), new Rule(23, new FunApp("Danish",[]),[],[[new Terminal("Danskas")]]), new Rule(22, new FunApp("Danish",[]),[],[[new Terminal("Danskan")]]), new Rule(21, new FunApp("Danish",[]),[],[[new Terminal("Danskans")]]), new Rule(20, new FunApp("Danish",[]),[],[[new Terminal("Danskor")]]), new Rule(19, new FunApp("Danish",[]),[],[[new Terminal("Danskors")]]), new Rule(18, new FunApp("Danish",[]),[],[[new Terminal("Danskorna")]]), new Rule(17, new FunApp("Danish",[]),[],[[new Terminal("Danskornas")]]), new Rule(65, new FunApp("Cut",[]),[],[[new Terminal("Klipper")]]), new Rule(64, new FunApp("Cut",[]),[],[[new Terminal("Klipps")]]), new Rule(63, new FunApp("Cut",[]),[],[[new Terminal("Klipp")]]), new Rule(62, new FunApp("Cut",[]),[],[[new Terminal("Klipps")]]), new Rule(61, new FunApp("Cut",[]),[],[[new Terminal("Klippa")]]), new Rule(60, new FunApp("Cut",[]),[],[[new Terminal("Klippas")]]), new Rule(59, new FunApp("Cut",[]),[],[[new Terminal("Klippt")]]), new Rule(58, new FunApp("Cut",[]),[],[[new Terminal("Klippts")]]), new Rule(57, new FunApp("Cut",[]),[],[[new Terminal("Klippt")]]), new Rule(56, new FunApp("Cut",[]),[],[[new Terminal("Klippts")]]), new Rule(55, new FunApp("Cut",[]),[],[[new Terminal("Klippta")]]), new Rule(54, new FunApp("Cut",[]),[],[[new Terminal("Klipptas")]]), new Rule(53, new FunApp("Cut",[]),[],[[new Terminal("Klippta")]]), new Rule(52, new FunApp("Cut",[]),[],[[new Terminal("Klipptas")]]), new Rule(51, new FunApp("Cut",[]),[],[[new Terminal("Klippta")]]), new Rule(50, new FunApp("Cut",[]),[],[[new Terminal("Klipptas")]]), new Rule(49, new FunApp("Cut",[]),[],[[new Terminal("ut")]]), new Rule(65, new FunApp("Copy",[]),[],[[new Terminal("Kopierar")]]), new Rule(64, new FunApp("Copy",[]),[],[[new Terminal("Kopieras")]]), new Rule(63, new FunApp("Copy",[]),[],[[new Terminal("Kopiera")]]), new Rule(62, new FunApp("Copy",[]),[],[[new Terminal("Kopieras")]]), new Rule(61, new FunApp("Copy",[]),[],[[new Terminal("Kopiera")]]), new Rule(60, new FunApp("Copy",[]),[],[[new Terminal("Kopieras")]]), new Rule(59, new FunApp("Copy",[]),[],[[new Terminal("Kopierad")]]), new Rule(58, new FunApp("Copy",[]),[],[[new Terminal("Kopierads")]]), new Rule(57, new FunApp("Copy",[]),[],[[new Terminal("Kopierat")]]), new Rule(56, new FunApp("Copy",[]),[],[[new Terminal("Kopierats")]]), new Rule(55, new FunApp("Copy",[]),[],[[new Terminal("Kopierade")]]), new Rule(54, new FunApp("Copy",[]),[],[[new Terminal("Kopierades")]]), new Rule(53, new FunApp("Copy",[]),[],[[new Terminal("Kopierade")]]), new Rule(52, new FunApp("Copy",[]),[],[[new Terminal("Kopierades")]]), new Rule(51, new FunApp("Copy",[]),[],[[new Terminal("Kopierade")]]), new Rule(50, new FunApp("Copy",[]),[],[[new Terminal("Kopierades")]]), new Rule(49, new FunApp("Copy",[]),[],[[]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[36, 48, 40, 33],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0), new Terminal("dig")]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[36, 47, 40, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0), new Terminal("dig")]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[36, 46, 44, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0), new Terminal("dig")]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[36, 43, 40, 22],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0), new Terminal("dig")]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[36, 42, 40, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0), new Terminal("dig")]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[36, 39, 37, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0), new Terminal("dig")]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[35, 48, 40, 33],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[35, 47, 40, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[35, 46, 44, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[35, 43, 40, 22],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[35, 42, 40, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[35, 39, 37, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[27, 48, 40, 33],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[27, 47, 40, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[27, 46, 44, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(44, new Arg(0),[14],[[new ArgProj(0, 0)]]), new Rule(44, new Arg(0),[45],[[new ArgProj(0, 0)]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[27, 43, 40, 22],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[27, 42, 40, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(40, new Arg(0),[10],[[new ArgProj(0, 0)]]), new Rule(40, new Arg(0),[41],[[new ArgProj(0, 0)]]), new Rule(25, new FunApp("CommandAdj",[new Arg(0), new Arg(1), new Arg(2), new Arg(3)]),[27, 39, 37, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new ArgProj(3, 0)]]), new Rule(37, new Arg(0),[16],[[new ArgProj(0, 0)]]), new Rule(37, new Arg(0),[38],[[new ArgProj(0, 0)]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[36, 34, 33],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("dig")]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[36, 32, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("dig")]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[36, 31, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("dig")]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[36, 29, 22],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("dig")]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[36, 28, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("dig")]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[36, 26, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0), new Terminal("dig")]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[35, 34, 33],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[35, 32, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[35, 31, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[35, 29, 22],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[35, 28, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[35, 26, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[27, 34, 33],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[27, 32, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[27, 31, 30],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[27, 29, 22],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[27, 28, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(25, new FunApp("Command",[new Arg(0), new Arg(1), new Arg(2)]),[27, 26, 24],[[new ArgProj(0, 1), new ArgProj(0, 0), new ArgProj(1, 0), new ArgProj(2, 0)]]), new Rule(24, new FunApp("Bulgarian",[]),[],[[new Terminal("Bulgariska")]]), new Rule(23, new FunApp("Bulgarian",[]),[],[[new Terminal("Bulgariskas")]]), new Rule(22, new FunApp("Bulgarian",[]),[],[[new Terminal("Bulgariskan")]]), new Rule(21, new FunApp("Bulgarian",[]),[],[[new Terminal("Bulgariskans")]]), new Rule(20, new FunApp("Bulgarian",[]),[],[[new Terminal("Bulgariskor")]]), new Rule(19, new FunApp("Bulgarian",[]),[],[[new Terminal("Bulgariskors")]]), new Rule(18, new FunApp("Bulgarian",[]),[],[[new Terminal("Bulgariskorna")]]), new Rule(17, new FunApp("Bulgarian",[]),[],[[new Terminal("Bulgariskornas")]]), new Rule(16, new FunApp("Available",[]),[],[[new Terminal("tillgänglig")]]), new Rule(15, new FunApp("Available",[]),[],[[new Terminal("tillgängligs")]]), new Rule(14, new FunApp("Available",[]),[],[[new Terminal("tillgängligt")]]), new Rule(13, new FunApp("Available",[]),[],[[new Terminal("tillgängligts")]]), new Rule(12, new FunApp("Available",[]),[],[[new Terminal("tillgängliga")]]), new Rule(11, new FunApp("Available",[]),[],[[new Terminal("tillgängligas")]]), new Rule(10, new FunApp("Available",[]),[],[[new Terminal("tillgängliga")]]), new Rule(9, new FunApp("Available",[]),[],[[new Terminal("tillgängligas")]]), new Rule(8, new FunApp("Available",[]),[],[[new Terminal("tillgängliga")]]), new Rule(7, new FunApp("Available",[]),[],[[new Terminal("tillgängligas")]]), new Rule(6, new FunApp("Available",[]),[],[[new Terminal("tillgängligare")]]), new Rule(5, new FunApp("Available",[]),[],[[new Terminal("tillgängligares")]]), new Rule(4, new FunApp("Available",[]),[],[[new Terminal("tillgängligast")]]), new Rule(3, new FunApp("Available",[]),[],[[new Terminal("tillgängligasts")]]), new Rule(2, new FunApp("Available",[]),[],[[new Terminal("tillgängligaste")]]), new Rule(1, new FunApp("Available",[]),[],[[new Terminal("tillgängligastes")]])],{Adjective:[37, 38, 16, 15, 44, 45, 14, 13, 12, 11, 40, 41, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], Determiner:[95, 77, 91, 73, 93, 75, 87, 69, 39, 42, 43, 89, 71, 26, 28, 29, 85, 67, 94, 76, 90, 72, 92, 74, 86, 68, 46, 47, 48, 88, 70, 31, 32, 34, 84, 66], Float:[-3], Int:[-2], Noun:[96, 24, 30, 20, 81, 22, 33, 18, 79, 23, 83, 19, 80, 21, 82, 17, 78], Sentence:[25], String:[-1], Verb:[65, 49, 27, 36, 35, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50], _Var:[-4]}))});
diff --git a/src/runtime/javascript/empty.png b/src/runtime/javascript/empty.png
new file mode 100644
index 000000000..35d9875df
--- /dev/null
+++ b/src/runtime/javascript/empty.png
Binary files differ
diff --git a/src/runtime/javascript/gfjseditor.js b/src/runtime/javascript/gfjseditor.js
new file mode 100644
index 000000000..5deb86160
--- /dev/null
+++ b/src/runtime/javascript/gfjseditor.js
@@ -0,0 +1,1267 @@
+
+//Variable and Constant definitions
+
+var expColImg = new Array(2);
+expColImg[0] = new Image(12,12);
+expColImg[0].src = "minus.png";
+expColImg[1] = new Image(12,12);
+expColImg[1].src = "plus.png";
+expColImg[2] = new Image(12,12);
+expColImg[2].src = "empty.png";
+
+// Grammars
+var grammar = undefined;
+var editorGrammar = Editor;
+
+var selectedLanguage = "EditorEng";
+var selectedNode = "";
+var collapseBuffer = new Array();
+var abstractTree = new Fun ("?");
+
+var navigationControlString = new Array();
+var undoArray = new Array();
+var redoArray = new Array();
+var clipBoard;
+var refPageCounter = 0;
+
+var stringAbstractTree = undefined;
+var myTree = undefined;
+var parseTrees = undefined;
+
+var keys = new Array();
+keys ["Z"] = function() { clickUndo('actUndo'); }
+keys ["Y"] = function() { clickRedo('actRedo'); }
+keys ["R"] = function() { clickRefine('actRefine'); };
+keys ["V"] = function() { clickPaste('actPaste'); };
+keys ["X"] = function() { clickCut('actCut'); };
+keys ["C"] = function() { clickCopy('actCopy'); };
+keys ["D"] = function() { clickDelete('actDelete'); };
+keys ["E"] = function() { clickReplace('actReplace'); };
+keys ["W"] = function() { clickWrap('actWrap'); };
+keys ["P"] = function() { clickParse('actParse'); };
+keys ["N"] = function() { clickRandomNode('actRandomNode'); };
+keys ["T"] = function() { clickRandomTree('actRandomTree'); };
+keys ["%"] = function() { leftArrowKey(); };
+keys ["&"] = function() { upDownArrowKey(-1); };
+keys ["'"] = function() { rightArrowKey(); };
+keys ["("] = function() { upDownArrowKey( 1); };
+keys ["27"] = function() { clickEsc(); };
+
+function state(selectedNode, tree, collapseBuffer) {
+ this.selectedNode = selectedNode;
+ this.tree = grammar.abstract.copyTree(tree);
+ this.collapseBuffer = collapseBuffer;
+ return this;
+}
+
+function treeNode(name, caption) {
+ this.name = name;
+ this.caption = caption;
+ this.cat = "";
+ this.children = new Array();
+ this.collapsed = false;
+ return this;
+}
+
+treeNode.prototype.addChild = function (i, c) {
+ this.children[i] = c;
+}
+
+treeNode.prototype.hasChildren = function() {
+ return this.children.length;
+}
+
+/* -------------------------------------------------------------------------- */
+/* ----------------------------- GUI functions ----------------------------- */
+/* -------------------------------------------------------------------------- */
+
+
+// Creates an instance of the editor and stores it in the given HTML container.
+// Previous content is destroyed.
+function mkEditor(container, myGrammar) {
+ grammar = myGrammar;
+ myTree = treeFromAbstract(grammar.abstract.annotate(abstractTree, grammar.abstract.startcat), "0");
+ var holder = document.getElementById(container);
+ holder.innerHTML = "<div id='wrapper'><div id='absFrame'></div><div id='conFrame'></div><div id='actFrame'></div><div id='refFrame'></div><div id='messageFrame'></div><div id='clipboardFrame'></div></div>";
+ nodeClick('0', '?');
+}
+
+// Generates a tree from the string representation of an abstract tree contained in the element elementToParse
+function parseStringTree(elementToParse) {
+ stringAbstractTree = elementToParse;
+ abstractTree = grammar.abstract.handleLiterals(grammar.abstract.parseTree(document.getElementById(elementToParse).value, grammar.abstract.startcat));
+ myTree = treeFromAbstract(abstractTree, "0");
+ nodeClick("0");
+}
+
+// If a key is pressed and a function assigned to that key, calls the function
+function hotKeys(event) {
+ event = (event) ? event : ((window.event) ? event : null);
+ if (event) {
+ var charCode = (event.charCode) ? event.charCode : ((event.which) ? event.which : event.keyCode);
+ if (keys[String.fromCharCode(charCode).toUpperCase()] &&
+ !event.ctrlKey && !event.altKey && !event.shiftKey && !event.metaKey) {
+ keys[String.fromCharCode(charCode).toUpperCase()]();
+ }
+ else if (keys["" + charCode] &&
+ !event.ctrlKey && !event.altKey && !event.shiftKey && !event.metaKey) {
+ keys["" + charCode]();
+ }
+ else if (charCode >= "96" && charCode <= "105" &&
+ !event.ctrlKey && !event.altKey && !event.shiftKey && !event.metaKey) {
+ keys["" + (charCode - 96)]();
+ }
+ }
+}
+
+// Clears "numeric" hotkeys
+function clearHotKeys() {
+ for (var key in keys) {
+ if ((parseInt(key) + 1) && (key != "27")) { keys[key] = function() { }; }
+ }
+}
+
+// Action to be performed when the up/down arrow key is pressed
+function upDownArrowKey(pos) {
+ var nodePos = getNavPos(selectedNode);
+ if ((nodePos > 0 && pos < 0) || (nodePos < navigationControlString.length - 1 && pos > 0)) {
+ nodeClick(navigationControlString[nodePos + pos]);
+ }
+}
+
+// Gets the position of a given node in the navigationControlString
+function getNavPos(nodeName) {
+ for (var i = 0, j = navigationControlString.length; i < j; i++) {
+ if (navigationControlString[i] == nodeName) { return i; };
+ }
+ return undefined;
+}
+
+// Given a name and a tree, gets the node in the tree with that name
+function getNode(nodeName, node) {
+ if (nodeName == node.name) {
+ return node;
+ }
+ else {
+ for (var i = 0, j = node.children.length; i < j; i++) {
+ var found = getNode(nodeName, node.children[i]);
+ if (found) { return found; }
+ }
+ }
+}
+
+// Action to be performed when the left arrow key is pressed
+function leftArrowKey() {
+ var node = getNode(selectedNode, myTree);
+ if (!node.collapsed && node.hasChildren()) {
+ signClick(node.name, node.caption);
+ }
+ else {
+ var parentNode = getParent(node.name, myTree);
+ if (parentNode) { nodeClick(parentNode.name); }
+ }
+}
+
+// Gets the parent of the selected node
+function getParent(nodeName, node) {
+ if (node.name == nodeName) {
+ return undefined;
+ }
+ else {
+ for (var i = 0, j = node.children.length; i < j; i++) {
+ if (node.children[i].name == nodeName) { return node; }
+ }
+ for (var i = 0, j = node.children.length; i < j; i++) {
+ var found = getParent(nodeName, node.children[i]);
+ if (found) { return found; }
+ }
+ }
+}
+
+// Action to be performed when the right arrow key is pressed
+function rightArrowKey() {
+ var node = getNode(selectedNode, myTree);
+ if (node.collapsed) {
+ signClick(node.name, node.caption);
+ }
+ else {
+ var firstDescendant = getfirstDescendant(node);
+ if (firstDescendant) {
+ nodeClick(firstDescendant.name);
+ }
+ }
+}
+
+// Gets the first descendant child of a node
+function getfirstDescendant(node) {
+ if (node.hasChildren() && !node.collapsed) { return node.children[0]; }
+ return undefined;
+}
+
+// Produces and displays an HTML representation of the tree
+function drawTree() {
+ var frame = document.getElementById("absFrame");
+ navigationControlString = new Array();
+ frame.innerHTML = "<ul id='tree'>" + getTree(myTree, 0) + "</ul>";
+ document.getElementById("link" + selectedNode).scrollIntoView(false);
+}
+
+// Produces an HTML representation of the tree
+function getTree(tree, level) {
+ navigationControlString[navigationControlString.length] = tree.name;
+ var htmlTree = new Array();
+ htmlTree.push("<li>");
+ if (tree.hasChildren()) {
+ htmlTree.push("<img class='tree-menu'");
+ if (tree.collapsed) {
+ htmlTree.push(" src='plus.png'");
+ }
+ else { htmlTree.push(" src='minus.png'"); }
+ htmlTree.push(" onclick='signClick(\"", tree.name, "\", \"", tree.caption, "\")' />");
+ }
+ else {
+ htmlTree.push("<img class='tree-menu' src='empty.png' />");
+ }
+ htmlTree.push("<a id='link", tree.name, "'");
+ if (document.getElementById("actRefine").className == "selected" ||
+ document.getElementById("actReplace").className == "selected" ||
+ document.getElementById("actWrap").className == "selected" ||
+ document.getElementById("actParse").className == "selected") {
+ htmlTree.push("class='treeGray' "); }
+ else if (selectedNode == tree.name) { htmlTree.push("class='treeSelected' "); }
+ else { htmlTree.push("class='tree' "); }
+ htmlTree.push("href='' onclick='nodeClick(\"", tree.name, "\"); return false'>");
+ if (tree.cat == "String" || tree.cat == "Int" || tree.cat == "Float") {
+ htmlTree.push(tree.caption.substring(tree.caption.lastIndexOf("_") + 1));
+ } else {
+ htmlTree.push(tree.caption);
+ }
+ htmlTree.push("&nbsp;:&nbsp;", tree.cat, "</a></li><ul>");
+ if (tree.hasChildren() && !tree.collapsed) {
+ for (var i = 0, j = tree.children.length; i < j; i++) {
+ htmlTree.push(getTree(tree.children[i], level + 1));
+ }
+ }
+ htmlTree.push("</ul>");
+ return htmlTree.join("");
+}
+
+// Linearizes and displays the abstract tree
+function drawLinearizedFrame() {
+ var frame = document.getElementById("conFrame");
+ frame.innerHTML = getLinearizedFrame();
+}
+
+// Linearizes the abstract tree and returns it in HTML form
+function getLinearizedFrame() {
+ var linearizedFrame = new Array();
+ for (var i in grammar.concretes) {
+ linearizedFrame.push("<h4>", i, "</h4>");
+ linearizedFrame.push("<p id='line", i, "'>");
+ var tokens = grammar.concretes[i].tagAndLinearize(abstractTree);
+ for (var j = 0, k = tokens.length; j < k; j++) {
+ linearizedFrame.push(createLinearized(tokens[j]));
+ }
+ linearizedFrame.push("</p>");
+ }
+ linearizedFrame.push("<h4>Abstract</h4>");
+ linearizedFrame.push("<p id='lineAbstract'>", createLinearizedFromAbstract(myTree, "0"), "</p>");
+ return linearizedFrame.join("");
+}
+
+// Creates an HTML representation of a linearization of an abstract tree
+function createLinearized(token) {
+ var node = getNode(token.tag, myTree);
+ var linearized = new Array()
+ linearized.push("<span id='", token.tag, "' class=");
+ if (node.name.substr(0, selectedNode.length) == selectedNode) {
+ linearized.push("'selected'");
+ }
+ else {
+ linearized.push("'normal'");
+ }
+ if (token == "&-") { linearized.push("<br />"); }
+ else { linearized.push(" onclick='nodeClick(\"", node.name, "\");'>&nbsp;", token, " </span>"); }
+ return linearized.join("");
+}
+
+// Creates an HTML representation of the abstract tree
+function createLinearizedFromAbstract(node, path, prec) {
+ var linearized = new Array();
+ linearized.push("<span id='", path, "' class=");
+ if (node.name.substr(0, selectedNode.length) == selectedNode) {
+ linearized.push("'selected'");
+ }
+ else {
+ linearized.push("'normal'");
+ }
+ linearized.push(" onclick='nodeClick(\"", node.name, "\");'>");
+ if (node.children.length) { linearized.push(" ("); }
+ if (node.cat == "String" || node.cat == "Int" || node.cat == "Float") {
+ linearized.push("&nbsp;", node.caption.substring(node.caption.lastIndexOf("_") + 1), "&nbsp;");
+ } else {
+ linearized.push("&nbsp;", node.caption, "&nbsp;");
+ }
+ for (var i = 0, j = node.children.length; i < j; i++) {
+ linearized.push(createLinearizedFromAbstract(node.children[i], path + "-" + i, 1));
+ }
+ if (node.children.length) { linearized.push(") "); }
+ linearized.push("</span>");
+ return linearized.join("");
+}
+
+// Expands/Collapses node
+function signClick(name, caption) {
+ myTree = expandCollapse(myTree, name);
+ nodeClick(name);
+}
+
+// Sets the "collapsed" property of a given node
+function expandCollapse(node, name) {
+ if (node.name == name) {
+ if (wasCollapsed(node.name)) { removeFromCollapseBuffer(node.name); }
+ else { collapseBuffer[collapseBuffer.length] = node.name; }
+ node.collapsed ^= true;
+ }
+ else {
+ for (var i = 0, j = node.children.length; i < j; i++) {
+ expandCollapse(node.children[i], name);
+ }
+ }
+ return node;
+}
+
+// Checks if a node was collapsed on the previous cycle
+function wasCollapsed(nodeName) {
+ for (var i = 0, j = collapseBuffer.length; i < j; i++) {
+ if (nodeName == collapseBuffer[i]) {
+ return true;
+ }
+ }
+ return false;
+}
+
+// Removes a node from the collapseBuffer array
+function removeFromCollapseBuffer(nodeName) {
+ var newBuffer = new Array();
+ for (var i = 0, j = collapseBuffer.length; i < j; i++) {
+ if (nodeName != collapseBuffer[i]) {
+ newBuffer[newBuffer.length] = collapseBuffer[i];
+ }
+ }
+ collapseBuffer = newBuffer;
+}
+
+// Selects a node
+function nodeClick(name) {
+ if ((document.getElementById("actRefine") && document.getElementById("actRefine").className == "selected") ||
+ (document.getElementById("actReplace") && document.getElementById("actReplace").className == "selected") ||
+ (document.getElementById("actWrap") && document.getElementById("actWrap").className == "selected") ||
+ (document.getElementById("actTree") && document.getElementById("actTree").className == "selected")) {
+ return; }
+ selectedNode = name;
+ if (stringAbstractTree) {
+ document.getElementById(stringAbstractTree).value = abstractTree.show();
+ }
+ document.getElementById("actFrame").innerHTML = showActions();
+ document.getElementById("refFrame").innerHTML = "";
+ document.getElementById("messageFrame").innerHTML = showLanguages();
+ document.getElementById(selectedLanguage).className = "selected";
+ applyLanguage();
+ drawTree();
+ drawLinearizedFrame();
+}
+
+// Shows the available languages for the editor
+function showLanguages() {
+ var languages = new Array();
+ languages.push("<table class='language' id='languagesTable'>",
+ "<tr id='langs' class='language'>",
+ "<td class='language' id='EditorDan' title='Label Bulgarian' onclick='clickLanguage(\"\")'>Bulgarian</td>",
+ "<td class='language' id='EditorDan' title='Label Danish' onclick='clickLanguage(\"\")'>Danish</td>",
+ "<td class='language' id='EditorEng' title='Label English' onclick='clickLanguage(\"EditorEng\")'>English</td>",
+ "<td class='language' id='EditorFin' title='Label Finnish' onclick='clickLanguage(\"\")'>Finnish</td>",
+ "<td class='language' id='EditorFre' title='Label French' onclick='clickLanguage(\"EditorFre\")'>French</td>",
+ "<td class='language' id='EditorGer' title='Label German' onclick='clickLanguage(\"\")'>German</td>",
+ "<td class='language' id='EditorIta' title='Label Italian' onclick='clickLanguage(\"\")'>Italian</td>",
+ "<td class='language' id='EditorNor' title='Label Norwegian' onclick='clickLanguage(\"\")'>Norwegian</td>",
+ "<td class='language' id='EditorRus' title='Label Russian' onclick='clickLanguage(\"\")'>Russian</td>",
+ "<td class='language' id='EditorSpa' title='Label Spanish' onclick='clickLanguage(\"EditorSpa\")'>Spanish</td>",
+ "<td class='language' id='EditorSwe' title='Label Swedish' onclick='clickLanguage(\"EditorSwe\")'>Swedish</td></tr>",
+ "</table>");
+ return languages.join("");
+}
+
+// Selects the language to use in the editor
+function clickLanguage(lang) {
+ if (lang) {
+ var tdsToClear = document.getElementById("languagesTable").getElementsByTagName("td");
+ for (var i = 0, j = tdsToClear.length; i < j; i++) {
+ if (tdsToClear[i].className == "selected") { tdsToClear[i].className = "language"; }
+ }
+ document.getElementById(lang).className = "selected";
+ selectedLanguage = lang;
+ applyLanguage();
+ }
+}
+
+// Applies a language to the editor
+function applyLanguage() {
+ var langsToLinearize = document.getElementById("languagesTable").getElementsByTagName("td");
+ for (var i = 0, j = langsToLinearize.length; i < j; i++) {
+ var absStr = langsToLinearize[i].getAttribute("title");
+ var lin = editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree(absStr, editorGrammar.abstract.startcat));
+ lin = lin.substring(0,1).toUpperCase().concat(lin.substring(1))
+ if (!langsToLinearize[i].firstChild) {
+ var txt = document.createTextNode(lin);
+ langsToLinearize[i].appendChild(txt);
+ }
+ else {
+ langsToLinearize[i].firstChild.nodeValue = lin;
+ }
+ }
+ var actionsToLinearize = document.getElementById("actionsTable").getElementsByTagName("td");
+ for (var i = 0, j = actionsToLinearize.length; i < j; i++) {
+ if (actionsToLinearize[i].className == "action") {
+ var absStr = actionsToLinearize[i].getAttribute("title");
+ var lin = editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree(absStr, editorGrammar.abstract.startcat));
+ lin = lin.substring(0,1).toUpperCase().concat(lin.substring(1))
+ if (!actionsToLinearize[i].firstChild) {
+ var txt = document.createTextNode(lin);
+ actionsToLinearize[i].appendChild(txt);
+ }
+ else {
+ actionsToLinearize[i].firstChild.nodeValue = lin;
+ }
+ }
+ }
+ var messageToLinearize = document.getElementById("refgenRefRandom");
+ if (messageToLinearize) {
+ var msg = editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree("RandomlyCommand Select IndefSgDet Refinement", editorGrammar.abstract.startcat));
+ messageToLinearize.firstChild.firstChild.nodeValue = msg.substring(0,1).toUpperCase().concat(msg.substring(1));
+ }
+ var messageToLinearize = document.getElementById("nextRefsNext");
+ if (messageToLinearize) {
+ var msg = editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree("CommandAdj Show DefSgDet Next Page", editorGrammar.abstract.startcat));
+ messageToLinearize.firstChild.firstChild.nodeValue = msg.substring(0,1).toUpperCase().concat(msg.substring(1));
+ }
+ messageToLinearize = document.getElementById("nextRefsPrevious");
+ if (messageToLinearize) {
+ var msg = editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree("CommandAdj Show DefSgDet Previous Page", editorGrammar.abstract.startcat));
+ messageToLinearize.firstChild.firstChild.nodeValue = msg.substring(0,1).toUpperCase().concat(msg.substring(1));
+ }
+ var messageToLinearize = document.getElementById("nextWrapsNext");
+ if (messageToLinearize) {
+ var msg = editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree("CommandAdj Show DefSgDet Next Page", editorGrammar.abstract.startcat));
+ messageToLinearize.firstChild.firstChild.nodeValue = msg.substring(0,1).toUpperCase().concat(msg.substring(1));
+ }
+ messageToLinearize = document.getElementById("nextWrapsPrevious");
+ if (messageToLinearize) {
+ var msg = editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree("CommandAdj Show DefSgDet Previous Page", editorGrammar.abstract.startcat));
+ messageToLinearize.firstChild.firstChild.nodeValue = msg.substring(0,1).toUpperCase().concat(msg.substring(1));
+ }
+}
+
+// Shows the available actions for a node
+function showActions(caption) {
+ var node = getNode(selectedNode, myTree);
+ var abstractNode = getNodeFromAbstract(abstractTree, node.name, "0");
+ var actions = new Array();
+ actions.push("<table class='action' id='actionsTable'>");
+ if (undoArray.length) {
+ actions.push(createAction("Undo", "action", "SingleWordCommand Undo", "Z")); }
+ else { actions.push(createAction("Undo", "unavailable", "SingleWordCommand Undo", "Z")); };
+ if (redoArray.length) {
+ actions.push(createAction("Redo", "action", "SingleWordCommand Redo", "Y")); }
+ else { actions.push(createAction("Redo", "unavailable", "SingleWordCommand Redo", "Y")); }
+ if (node.caption == "?") {
+ actions.push(createAction("Cut", "unavailable", "SingleWordCommand Cut", "X"));
+ actions.push(createAction("Copy", "unavailable", "SingleWordCommand Copy", "C"));
+ var AbsNodeType = abstractNode.type;
+ if (clipBoard && (AbsNodeType == grammar.abstract.getCat(clipBoard.name))) {
+ actions.push(createAction("Paste", "action", "SingleWordCommand Paste", "V"));
+ }
+ else { actions.push(createAction("Paste", "unavailable", "SingleWordCommand Paste", "V")); }
+ actions.push(createAction("Delete", "unavailable", "SingleWordCommand Delete", "D"));
+ actions.push(createAction("Refine", "action", "SingleWordCommand Refine", "R"));
+ actions.push(createAction("Replace", "unavailable", "SingleWordCommand Replace", "E"));
+ actions.push(createAction("Wrap", "unavailable", "SingleWordCommand Wrap", "W"));
+ for (var i in grammar.concretes) {
+ if (grammar.concretes[i].parser) {
+ actions.push(createAction("Parse", "action", "Command Parse IndefSgDet String_N", "P"));
+ } else { actions.push(createAction("Parse", "unavailable", "Command Parse IndefSgDet String_N", "P")); }
+ break;
+ }
+ }
+ else if (node.caption) {
+ actions.push(createAction("Cut", "action", "SingleWordCommand Cut", "X"));
+ actions.push(createAction("Copy", "action", "SingleWordCommand Copy", "C"));
+ actions.push(createAction("Paste", "unavailable", "SingleWordCommand Paste", "V"));
+ actions.push(createAction("Delete", "action", "SingleWordCommand Delete", "D"));
+ actions.push(createAction("Refine", "unavailable", "SingleWordCommand Refine", "R"));
+ actions.push(createAction("Replace", "action", "SingleWordCommand Replace", "E"));
+ actions.push(createAction("Wrap", "action", "SingleWordCommand Wrap", "W"));
+ actions.push(createAction("Parse", "unavailable", "Command Parse IndefSgDet String_N", "P"));
+ }
+ if (node && !abstractNode.isComplete()) {
+ actions.push(createAction("RandomNode", "action", "RandomlyCommand Refine DefSgDet Node", "N"));
+ }
+ else {
+ actions.push(createAction("RandomNode", "unavailable", "RandomlyCommand Refine DefSgDet Node", "N"));
+ }
+ if (!abstractTree.isComplete()) {
+ actions.push(createAction("RandomTree", "action", "RandomlyCommand Refine DefSgDet Tree", "T"));
+ }
+ else {
+ actions.push(createAction("RandomTree", "unavailable", "RandomlyCommand Refine DefSgDet Tree", "T"));
+ }
+ actions.push("</table>");
+ return actions.join("");
+
+}
+
+// Creates an action
+function createAction(actionName, className, caption, hotKey) {
+ return "<tr id='act" + actionName + "' class='" + className +"' onclick='click" +
+ actionName + "(\"act" + actionName + "\")'><td class='action' title='" +
+ caption + "'>" + caption + "</td><td class='hotKey'>(" + hotKey + ")</td></tr>";
+}
+
+// When the "Refine" action is selected, gets the appropriate refinements for a node
+function clickRefine(actName) {
+ if (document.getElementById(actName).className == "action") {
+ highlightSelectedAction(actName);
+ pushUndoClearRedo();
+ if (selectedNode) {
+ refPageCounter = 0;
+ var node = getNodeFromAbstract(abstractTree, selectedNode, "0");
+ if (node.type == "String" || node.type == "Int" || node.type == "Float") {
+ var newType = undefined;
+ var newTypeCat = node.type + "_Literal_";
+ switch(node.type)
+ {
+ case "String":
+ var msg = editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree("Command Enter IndefSgDet String_N", editorGrammar.abstract.startcat));
+ newType = prompt(msg.substring(0,1).toUpperCase().concat(msg.substring(1)),'String');
+ if (!newType) { newType = "AutoString"; }
+ break;
+ case "Int":
+ while (isNaN(newType) || (newType && newType.indexOf(".") != -1)) {
+ var msg = editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree("Command Enter IndefSgDet Integer_N", editorGrammar.abstract.startcat));
+ newType = prompt(msg.substring(0,1).toUpperCase().concat(msg.substring(1)),'Int');
+ }
+ if (!newType) { newType = "8"; }
+ break;
+ case "Float":
+ while (isNaN(newType)) {
+ var msg = editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree("Command Enter IndefSgDet Float_N", editorGrammar.abstract.startcat));
+ newType = prompt(msg.substring(0,1).toUpperCase().concat(msg.substring(1)),'Float');
+ }
+ if (!newType) { newType = "8.0"; }
+ if (newType.indexOf(".") == -1) { newType += ".0"; }
+ break;
+ }
+ if (node.type == "String") {
+ newTypeCat += "\"" + newType + "\"";
+ } else {
+ newTypeCat += newType;
+ }
+ if (!grammar.abstract.types[newTypeCat]) {
+ grammar.abstract.addType(newTypeCat, [], node.type);
+ for (var i in grammar.concretes) {
+ grammar.concretes[i].addRule(newTypeCat, function(cs){ return new Arr(new Str(newType));});
+ }
+ }
+ node.name = newTypeCat;
+ abstractTree = insertNode(abstractTree, selectedNode, "0", node);
+ document.getElementById("actFrame").innerHTML = showActions();
+ document.getElementById("refFrame").innerHTML = "";
+ clearHotKeys();
+ concludeAction();
+ } else {
+ document.getElementById("refFrame").innerHTML = showRefinements(selectedNode);
+ }
+ }
+ }
+}
+
+// Sets the className of actName to "selected" and grays out the other selections
+function highlightSelectedAction(actName) {
+ graySelections(actName);
+ document.getElementById(actName).className = "selected";
+ drawTree();
+}
+
+// Grays out all actions except one
+function graySelections(except) {
+ var refs = document.getElementById("actFrame").getElementsByTagName("tr");
+ for (var i = 0, j = refs.length; i < j; i++) {
+ if (refs[i].id != except) { refs[i].className = "closed"; }
+ }
+}
+
+// Pushes the abstract tree into the undo array and clears the redo array
+function pushUndoClearRedo() {
+ undoArray.push(new state(selectedNode, abstractTree, collapseBuffer));
+ redoArray.length = 0;
+}
+
+// Gets the refinements to display
+function showRefinements(nodeName) {
+ var refs = getAvailableRefinements(nodeName, abstractTree, grammar);
+ var rowsPerPage = 9;
+ var pages = Math.floor(refs.length / rowsPerPage);
+ var upperLimit;
+ if (pages != refPageCounter) { upperLimit = (rowsPerPage * refPageCounter) + rowsPerPage; }
+ else { upperLimit = refs.length; }
+ var refinements = new Array();
+ refinements.push("<table class='refinement'>");
+ var keyPos = 0;
+ refinements.push(ref_wrapToHtml("ref", "genRefRandom", "refinement", "", keyPos, "RandomlyCommand Select IndefSgDet Refinement"));
+ keys["" + keyPos] = mkRefHotKey("genRefRandom");
+ keyPos++;
+ for (var i = (rowsPerPage * refPageCounter), j = upperLimit; i < j; i++) {
+ refinements.push(ref_wrapToHtml("ref", refs[i], "refinement", "", keyPos, ""));
+ keys["" + keyPos] = mkRefHotKey(refs[i]);
+ keyPos++;
+ }
+ if (((refs.length % rowsPerPage == 0) && (pages - 1) > refPageCounter) ||
+ ((refs.length % rowsPerPage != 0) && pages > refPageCounter) ) {
+ refinements.push(ref_wrapNextRefsToHtml("nextRefs", "Next", "refinement", "+", editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree("CommandAdj Show DefSgDet Next Page", editorGrammar.abstract.startcat))));
+ keys["107"] = mkRefNextRefsHotKey("Next");
+ }
+ if (0 < refPageCounter) {
+ refinements.push(ref_wrapNextRefsToHtml("nextRefs", "Previous", "refinement", "-", editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree("CommandAdj Show DefSgDet Previous Page", editorGrammar.abstract.startcat))));
+ keys["109"] = mkRefNextRefsHotKey("Previous");
+ }
+ refinements.push("</table>");
+ return refinements.join("");
+}
+
+// Creates an HTML representation of a Refinement/Wrap
+function ref_wrapToHtml(funct, name, className, arg, hotKeyPos, caption) {
+ var ref_wrapHtml = new Array();
+ ref_wrapHtml.push("<tr id='", funct, name, "' class=", className, " onclick='", funct, "Click(\"", name, "\"", arg, ")'><td class='", className, "'>");
+ if (caption) { ref_wrapHtml.push(editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree(caption, editorGrammar.abstract.startcat))); }
+ else { ref_wrapHtml.push(name, "&nbsp;:&nbsp;", refArgsToHtml(name), grammar.abstract.getCat(name)); }
+ ref_wrapHtml.push("</td><td class='hotKey'>(", hotKeyPos, ")</td></tr>");
+ return ref_wrapHtml.join("");
+}
+
+// Creates the function to be used by a "numeric" hot key
+function mkRefHotKey(refName) {
+ return function() { if (document.getElementById("ref" + refName)) { refClick(refName); } }
+}
+
+// Creates an HTML representation of the Next/Previous Refinement/Wrap page
+function ref_wrapNextRefsToHtml(funct, name, className, hotKeyPos, caption) {
+ var ref_wrapHtml = new Array();
+ ref_wrapHtml.push("<tr id='", funct, name, "' class=", className, " onclick='", funct, "Click(\"", name, "\")'><td class='", className, "'>");
+ ref_wrapHtml.push(caption);
+ ref_wrapHtml.push("</td><td class='hotKey'>(", hotKeyPos, ")</td></tr>");
+ return ref_wrapHtml.join("");
+}
+
+// Creates the function to be used by a "+"/"-" hot key
+function mkRefNextRefsHotKey(refName) {
+ return function() { if (document.getElementById("nextRefs" + refName)) { nextRefsClick(refName); } }
+}
+
+// Creates a string representation of the arguments of a refinement
+function refArgsToHtml(fun) {
+ var args = new Array();
+ for (var i = 0, j = grammar.abstract.types[fun].args.length; i < j; i++) {
+ args.push(grammar.abstract.types[fun].args[i], "&nbsp;->&nbsp;");
+ }
+ return args.join("");
+}
+
+// Gets the type of a meta variable
+function getMetaType(absNode, route, currRoute) {
+ if (route == currRoute && absNode.isMeta()) {
+ return absNode.type;
+ }
+ else {
+ for (var i = 0, j = absNode.args.length; i < j; i++) {
+ var found = getMetaType(absNode.args[i], route, currRoute + "-" + i);
+ if (found) { return found };
+ }
+ }
+}
+
+// When the "Undo" action is selected, undoes the last action
+function clickUndo(actName) {
+ if (document.getElementById(actName).className == "action" && undoArray.length) {
+ highlightSelectedAction(actName);
+ redoArray.push(new state(selectedNode, abstractTree, collapseBuffer));
+ var prevState = undoArray.pop();
+ selectedNode = prevState.selectedNode;
+ abstractTree = grammar.abstract.copyTree(prevState.tree);
+ collapseBuffer = prevState.collapseBuffer;
+ if (abstractTree.isComplete()) { selectedNode = "0"; }
+ abstractTree = grammar.abstract.annotate(abstractTree, grammar.abstract.startcat);
+ myTree = treeFromAbstract(abstractTree, "0");
+ nodeClick(selectedNode);
+ }
+}
+
+// When the "Redo" action is selected, redoes the last action
+function clickRedo(actName) {
+ if (document.getElementById(actName).className == "action" && redoArray.length) {
+ highlightSelectedAction(actName);
+ undoArray.push(new state(selectedNode, abstractTree, collapseBuffer));
+ var nextState = redoArray.pop();
+ selectedNode = nextState.selectedNode;
+ abstractTree = grammar.abstract.copyTree(nextState.tree);
+ collapseBuffer = nextState.collapseBuffer;
+ abstractTree = grammar.abstract.annotate(abstractTree, grammar.abstract.startcat);
+ myTree = treeFromAbstract(abstractTree, "0");
+ nodeClick(selectedNode);
+ }
+}
+
+// When the "Copy" action is selected, copies the selected node to the clipboard
+function clickCopy(actName) {
+ if (document.getElementById(actName).className == "action") {
+ highlightSelectedAction(actName);
+ if (selectedNode) {
+ clipBoard = grammar.abstract.copyTree(getNodeFromAbstract(abstractTree, selectedNode, "0"));
+ document.getElementById("clipboardFrame").innerHTML = clipBoard.name + "&nbsp;:&nbsp;" + grammar.abstract.getCat(clipBoard.name);
+ nodeClick(selectedNode);
+ }
+ }
+}
+
+// When the "Cut" action is selected, deletes the selected node and copies it to the clipboard
+function clickCut(actName) {
+ if (document.getElementById(actName).className == "action") {
+ highlightSelectedAction(actName);
+ pushUndoClearRedo();
+ if (selectedNode) {
+ clipBoard = grammar.abstract.copyTree(getNodeFromAbstract(abstractTree, selectedNode, "0"));
+ document.getElementById("clipboardFrame").innerHTML = clipBoard.name + "&nbsp;:&nbsp;" + grammar.abstract.getCat(clipBoard.name);
+ abstractTree = deleteNode(abstractTree, selectedNode, "0");
+ concludeAction();
+ }
+ }
+}
+
+// Annotates the abstract tree, creates a tree from the abstract tree and selects the next meta variable
+function concludeAction() {
+ abstractTree = grammar.abstract.annotate(abstractTree, grammar.abstract.startcat);
+ myTree = treeFromAbstract(abstractTree, "0");
+ selectNextMeta();
+}
+
+// Selects the next meta variable available
+function selectNextMeta() {
+ nodeClick(selectedNode);
+ if (!abstractTree.isComplete()) {
+ var pathToNextMeta = "";
+ var nodePos = getNavPos(selectedNode);
+ while (1) {
+ if (nodePos == navigationControlString.length) { nodePos = 0; }
+ var node = getNode(navigationControlString[nodePos], myTree);
+ if (node.caption == "?") { pathToNextMeta = node.name; break; }
+ nodePos++;
+ }
+ expandAscendants(pathToNextMeta);
+ nodeClick(pathToNextMeta);
+ }
+}
+
+// Expands the ascendants of a given node
+function expandAscendants(nodeName) {
+ var nodePath = nodeName.split("-");
+ var currAscendant = nodePath.shift();
+ while (nodePath.length > 0) {
+ var node = getNode(currAscendant, myTree);
+ if (node.collapsed) {
+ myTree = expandCollapse(myTree, currAscendant);
+ }
+ currAscendant += "-" + nodePath.shift();
+ }
+}
+
+// When the "Paste" action is selected, pastes the contents of the clipboard into the selected node
+function clickPaste(actName) {
+ if (document.getElementById(actName).className == "action") {
+ highlightSelectedAction(actName);
+ pushUndoClearRedo();
+ if (selectedNode) {
+ abstractTree = insertNode(abstractTree, selectedNode, "0", grammar.abstract.copyTree(clipBoard));
+ concludeAction();
+ }
+ }
+}
+
+// When the "Delete" action is selected, deletes the selected node
+function clickDelete(actName) {
+ if (document.getElementById(actName).className == "action") {
+ highlightSelectedAction(actName);
+ pushUndoClearRedo();
+ if (selectedNode) {
+ abstractTree = deleteNode(abstractTree, selectedNode, "0");
+ abstractTree = grammar.abstract.annotate(abstractTree, grammar.abstract.startcat);
+ myTree = treeFromAbstract(abstractTree, "0");
+ nodeClick(selectedNode);
+ }
+ }
+}
+
+// When the "Replace" action is selected, replaces the selected node with another refinement
+function clickReplace(actName) {
+ if (document.getElementById(actName).className == "action") {
+ highlightSelectedAction(actName);
+ pushUndoClearRedo();
+ if (selectedNode) {
+ refPageCounter = 0;
+ abstractTree = deleteNode(abstractTree, selectedNode, "0");
+ abstractTree = grammar.abstract.annotate(abstractTree, grammar.abstract.startcat);
+ myTree = treeFromAbstract(abstractTree, "0");
+ drawTree();
+ document.getElementById("refFrame").innerHTML = showRefinements(selectedNode);
+ }
+ }
+}
+
+// When the "Wrap" action is selected, wraps around the selected node with another refinement
+function clickWrap(actName) {
+ if (document.getElementById(actName).className == "action") {
+ highlightSelectedAction(actName);
+ pushUndoClearRedo();
+ var node = getNode(selectedNode, myTree);
+ if (selectedNode) {
+ refPageCounter = 0;
+ var wrappers = showWrappers(node.caption);
+ document.getElementById("refFrame").innerHTML = wrappers;
+ if (wrappers.length <= 31) {
+ var lin = editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree("ErrorMessage Available Wrapper", editorGrammar.abstract.startcat));
+ alert(lin.substring(0,1).toUpperCase().concat(lin.substring(1)));
+ document.getElementById("actFrame").innerHTML = showActions();
+ nodeClick(selectedNode);
+ }
+ }
+ }
+}
+
+// Gets the wrappers to display
+function showWrappers(nodeCaption) {
+ var nodeType = grammar.abstract.types[nodeCaption].cat;
+ var rowsPerPage = 10;
+ var availWrappers = getAvailableWrappers(nodeType, grammar, selectedNode);
+ var pages = Math.floor(availWrappers.length / rowsPerPage);
+ var upperLimit;
+ if (pages != refPageCounter) { upperLimit = (rowsPerPage * refPageCounter) + rowsPerPage; }
+ else { upperLimit = availWrappers.length; }
+ var wrappers = new Array();
+ wrappers.push("<table class='wrapper'>");
+ var keyPos = 0;
+ for (var i = (rowsPerPage * refPageCounter), j = upperLimit; i < j; i++) {
+ wrappers.push(ref_wrapToHtml("wrap", availWrappers[i][0], "wrapper", ", " + availWrappers[i][1], keyPos, ""));
+ keys["" + keyPos] = mkWrapHotKey(availWrappers[i][0], availWrappers[i][1]);
+ keyPos++;
+ }
+ if (((availWrappers.length % rowsPerPage == 0) && (pages - 1) > refPageCounter) ||
+ ((availWrappers.length % rowsPerPage != 0) && pages > refPageCounter) ) {
+ wrappers.push(ref_wrapNextRefsToHtml("nextWraps", "Next", "wrapper", "+", editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree("CommandAdj Show DefSgDet Next Page", editorGrammar.abstract.startcat))));
+ keys["107"] = mkWrapNextRefsHotKey("Next");
+ }
+ if (0 < refPageCounter) {
+ wrappers.push(ref_wrapNextRefsToHtml("nextWraps", "Previous", "wrapper", "-", editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree("CommandAdj Show DefSgDet Previous Page", editorGrammar.abstract.startcat))));
+ keys["109"] = mkWrapNextRefsHotKey("Previous");
+ }
+ wrappers.push("</table>");
+ return wrappers.join("");
+}
+
+// Creates the function to be used by a "numeric" hot key
+function mkWrapHotKey(wrapName, argPos) {
+ return function() { if (document.getElementById("wrap" + wrapName)) { wrapClick(wrapName, argPos); } }
+}
+
+// Creates the function to be used by a "+"/"-" hot key
+function mkWrapNextRefsHotKey(wrapName) {
+ return function() { if (document.getElementById("nextWraps" + wrapName)) { nextWrapsClick(wrapName); } }
+}
+
+// When the "Parse" action is selected, asks the user for a string and parses it
+// to generate the subnode
+function clickParse(actName) {
+ if (document.getElementById(actName).className == "action") {
+ highlightSelectedAction(actName);
+ var node = getNode(selectedNode, myTree);
+ if (selectedNode) {
+ refPageCounter = 0;
+ parseTrees = undefined;
+ var msg = editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree("Command Enter IndefSgDet String_N", editorGrammar.abstract.startcat));
+ var string = prompt(msg.substring(0,1).toUpperCase().concat(msg.substring(1)),'String');
+ if (string || string == "") {
+ for (var i in grammar.concretes) {
+ parseTrees = grammar.concretes[i].parser.parseString(string, node.cat);
+ if (parseTrees.length == 1) {
+ pushUndoClearRedo();
+ abstractTree = insertNode(abstractTree, selectedNode, "0", grammar.abstract.copyTree(grammar.abstract.handleLiterals(parseTrees[0], node.cat)));
+ document.getElementById("actFrame").innerHTML = showActions();
+ document.getElementById("refFrame").innerHTML = "";
+ clearHotKeys();
+ concludeAction();
+ return false;
+ } else if (parseTrees.length > 1) {
+ document.getElementById("refFrame").innerHTML = showTrees();
+ return false;
+ }
+ }
+ } else { nodeClick(selectedNode); return false; }
+ var lin = editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree("ErrorMessage Available Tree", editorGrammar.abstract.startcat));
+ alert(lin.substring(0,1).toUpperCase().concat(lin.substring(1)));
+ }
+ nodeClick(selectedNode);
+ }
+}
+
+// Displays the parse trees in the refinements panel
+function showTrees() {
+ var rowsPerPage = 10;
+ var pages = Math.floor(parseTrees.length / rowsPerPage);
+ var upperLimit;
+ if (pages != refPageCounter) { upperLimit = (rowsPerPage * refPageCounter) + rowsPerPage; }
+ else { upperLimit = parseTrees.length; }
+ var htmlTrees = new Array();
+ htmlTrees.push("<table class='tree'>");
+ var keyPos = 0;
+ for (var i = (rowsPerPage * refPageCounter), j = upperLimit; i < j; i++) {
+ htmlTrees.push(treeToHtml(i, keyPos, ""));
+ keys["" + keyPos] = mkTreeHotKey(i, keyPos);
+ keyPos++;
+ }
+ if (((parseTrees.length % rowsPerPage == 0) && (pages - 1) > refPageCounter) ||
+ ((parseTrees.length % rowsPerPage != 0) && pages > refPageCounter) ) {
+ htmlTrees.push(ref_wrapNextRefsToHtml("nextTrees", "Next", "tree", "+", editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree("CommandAdj Show DefSgDet Next Page", editorGrammar.abstract.startcat))));
+ keys["107"] = mkTreeNextRefsHotKey("Next");
+ }
+ if (refPageCounter > 0) {
+ htmlTrees.push(ref_wrapNextRefsToHtml("nextTrees", "Previous", "tree", "-", editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree("CommandAdj Show DefSgDet Previous Page", editorGrammar.abstract.startcat))));
+ keys["109"] = mkTreeNextRefsHotKey("Previous");
+ }
+ htmlTrees.push("</table>");
+ return htmlTrees.join("");
+}
+
+// Creates an HTML representation of a parse Tree to be shown in the refinements panel
+function treeToHtml(i, hotKeyPos, caption) {
+ var htmlTree = new Array();
+ htmlTree.push("<tr id='tree", hotKeyPos, "' class='tree' onclick='treeClick(", i, ")'><td class='tree'>");
+ if (caption) { htmlTree.push(editorGrammar.concretes[selectedLanguage].linearize(editorGrammar.abstract.parseTree(caption, editorGrammar.abstract.startcat))); }
+ else { htmlTree.push(parseTrees[i].show()); }
+ htmlTree.push("</td><td class='hotKey'>(", hotKeyPos, ")</td></tr>");
+ return htmlTree.join("");
+}
+
+// Creates the function to be used by a "numeric" hot key
+function mkTreeHotKey(i, keyPos) {
+ return function() { if (document.getElementById("tree" + keyPos)) { treeClick(i); } }
+}
+
+// Creates the function to be used by a "+"/"-" hot key
+function mkTreeNextRefsHotKey(treeName) {
+ return function() { if (document.getElementById("nextTrees" + treeName)) { nextTreesClick(treeName); } }
+}
+
+
+// When the "RandomNode" action is selected, refines the node at random
+function clickRandomNode(actName) {
+ if (document.getElementById(actName).className == "action") {
+ highlightSelectedAction(actName);
+ pushUndoClearRedo();
+ if (selectedNode) {
+ var tempTree = grammar.abstract.copyTree(abstractTree);
+ abstractTree = insertNode(tempTree, selectedNode, "0", grammar.abstract.copyTree(fillSubTree(grammar.abstract.copyTree(getNodeFromAbstract(abstractTree, selectedNode, "0")), grammar)));
+ concludeAction();
+ }
+ }
+}
+
+// When the "RandomTree" action is selected, refines the tree at random
+function clickRandomTree(actName) {
+ if (document.getElementById(actName).className == "action") {
+ highlightSelectedAction(actName);
+ pushUndoClearRedo();
+ abstractTree = grammar.abstract.copyTree(fillSubTree(abstractTree, grammar));
+ concludeAction();
+ }
+}
+
+// If a node is selected and is of type meta, it refines the node with a type refName
+function refClick(refName) {
+ if (selectedNode) {
+ if (refName == "genRefRandom") {
+ var refs = getAvailableRefinements(selectedNode, abstractTree, grammar);
+ refName = refs[Math.floor(refs.length * Math.random())];
+ }
+ abstractTree = refineAbstractTree(abstractTree, selectedNode, "0", refName);
+ document.getElementById("actFrame").innerHTML = showActions();
+ document.getElementById("refFrame").innerHTML = "";
+ clearHotKeys();
+ concludeAction();
+ }
+}
+
+// Creates a tree from an abstract tree
+function treeFromAbstract(abstractNode, name) {
+ var node = new treeNode(name, abstractNode.name);
+ if (node.caption == "?") {
+ node.cat = abstractNode.type; }
+ else {
+ if (grammar.abstract.types[node.caption]) {
+ node.cat = grammar.abstract.getCat(node.caption);
+ } else {
+ node.cat = node.caption.substring(0, node.caption.indexOf("_"));
+ grammar.abstract.addType(node.caption, [], node.cat);
+ var linStr = undefined;
+ if (node.cat == "String") {
+ linStr = node.caption.substring(node.caption.indexOf("\"") + 1, node.caption.length - 1);
+ } else {
+ linStr = node.caption.substring(node.caption.lastIndexOf("_") + 1)
+ }
+ for (var i in grammar.concretes) {
+ grammar.concretes[i].addRule(node.caption, function(cs){ return new Arr(new Str(linStr));});
+ }
+ }
+ }
+ if (wasCollapsed(node.name)) { node.collapsed = true; }
+ for (var i = 0, j = abstractNode.args.length; i < j; i++) {
+ node.addChild(i, treeFromAbstract(abstractNode.args[i], name + "-" + i));
+ }
+ return node
+}
+
+// Wraps a refinement around a node
+function wrapClick(wrapName, argPos) {
+ if (selectedNode) {
+ var tempNode = createRefinement(wrapName);
+ tempNode.setArg(argPos, grammar.abstract.copyTree(getNodeFromAbstract(abstractTree, selectedNode, "0")));
+ abstractTree = insertNode(abstractTree, selectedNode, "0", tempNode);
+ var cat = grammar.abstract.getCat(tempNode.name);
+ if (selectedNode == "0" && cat != grammar.abstract.startcat) {
+ grammar.abstract.startcat = cat;
+ }
+ document.getElementById("actFrame").innerHTML = showActions();
+ document.getElementById("refFrame").innerHTML = "";
+ clearHotKeys();
+ concludeAction();
+ }
+}
+
+// Wraps a refinement around a node
+function treeClick(i) {
+ if (selectedNode) {
+ pushUndoClearRedo();
+ var node = getNode(selectedNode, myTree);
+ var tempNode = grammar.abstract.copyTree(grammar.abstract.handleLiterals(parseTrees[i], node.cat));
+ abstractTree = insertNode(abstractTree, selectedNode, "0", tempNode);
+ document.getElementById("actFrame").innerHTML = showActions();
+ document.getElementById("refFrame").innerHTML = "";
+ clearHotKeys();
+ concludeAction();
+ }
+}
+
+// Handler for the escape key
+function clickEsc() {
+ if ((document.getElementById("actRefine").className == "selected" ||
+ document.getElementById("actReplace").className == "selected" ||
+ document.getElementById("actWrap").className == "selected" ||
+ document.getElementById("actParse").className == "selected") && undoArray.length) {
+ var prevState = undoArray.pop();
+ selectedNode = prevState.selectedNode;
+ abstractTree = grammar.abstract.copyTree(prevState.tree);
+ collapseBuffer = prevState.collapseBuffer;
+ abstractTree = grammar.abstract.annotate(abstractTree, grammar.abstract.startcat);
+ myTree = treeFromAbstract(abstractTree, "0");
+ document.getElementById("actFrame").innerHTML = showActions();
+ if (selectedNode) { nodeClick(selectedNode) }
+ }
+}
+
+// If there are over ten refinements available shows only the selected nine
+function nextRefsClick(refName) {
+ if (refName == "Next") { refPageCounter++; } else { refPageCounter--; }
+ clearHotKeys();
+ document.getElementById("refFrame").innerHTML = showRefinements(selectedNode);
+}
+
+// If there are over ten wrappers available shows only the selected nine
+function nextWrapsClick(wrapName) {
+ if (wrapName == "Next") { refPageCounter++; } else { refPageCounter--; }
+ clearHotKeys();
+ var node = getNode(selectedNode, myTree);
+ document.getElementById("refFrame").innerHTML = showWrappers(node.caption);
+}
+
+// If there are over ten parse trees available shows only the selected nine
+function nextTreesClick(treeName) {
+ if (treeName == "Next") { refPageCounter++; } else { refPageCounter--; }
+ clearHotKeys();
+ document.getElementById("refFrame").innerHTML = showTrees();
+}
+
+/* -------------------------------------------------------------------------- */
+/* ---------- GUI independent functions to handle syntax editing ---------- */
+/* -------------------------------------------------------------------------- */
+
+// Gets the node rooted at the indicated path (route) in the tree absNode
+function getNodeFromAbstract(absNode, route, currRoute) {
+ if (route == currRoute) {
+ return absNode;
+ }
+ else {
+ for (var i = 0, j = absNode.args.length; i < j; i++) {
+ var found = getNodeFromAbstract(absNode.args[i], route, currRoute + "-" + i);
+ if (found) { return found; }
+ }
+ }
+}
+
+// Gets the first metavariable from the abstract tree rooted at the path route
+function getNextMetaFromAbstract(node, route) {
+ if (node.isMeta()) { return route; }
+ for (var i = 0, j = node.args.length; i < j; i++) {
+ var found = getNextMetaFromAbstract(node.args[i], route + "-" + i);
+ if (found) { return found; }
+ }
+}
+
+// Inserts the node into the abstract tree absNode at the path route
+function insertNode(absNode, route, currRoute, node) {
+ if (route == currRoute) {
+ return node;
+ }
+ else {
+ for (var i = 0, j = absNode.args.length; i < j; i++) {
+ absNode.setArg(i, insertNode(absNode.args[i], route, currRoute + "-" + i, node));
+ }
+ return absNode;
+ }
+}
+
+// Deletes the node rooted at the path route from the abstract tree absNode
+function deleteNode(absNode, route, currRoute) {
+ if (route == currRoute) {
+ return new Fun("?");
+ }
+ else {
+ for (var i = 0, j = absNode.args.length; i < j; i++) {
+ absNode.setArg(i, deleteNode(absNode.args[i], route, currRoute + "-" + i));
+ }
+ return absNode;
+ }
+}
+
+// Gets the available refinements for the node nodeName, which is in the tree
+// abstractTree, from those found in the grammar.
+function getAvailableRefinements(nodeName, abstractTree, grammar) {
+ var node = getNodeFromAbstract(abstractTree, nodeName, "0");
+ var metaType = node.type;
+ var refinements = new Array();
+ for (var fun in grammar.abstract.types) {
+ if (grammar.abstract.types[fun].cat == metaType) {
+ refinements[refinements.length] = fun;
+ }
+ }
+ return refinements;
+}
+
+// It refines the node rooted at the path route in the abstract tree absNode
+// with the refinement refName. Returns the refined abstract tree.
+function refineAbstractTree(absNode, route, currRoute, refName) {
+ if (route == currRoute && absNode.isMeta()) {
+ return createRefinement(refName);
+ }
+ else {
+ for (var i = 0, j = absNode.args.length; i < j; i++) {
+ absNode.setArg(i, refineAbstractTree(absNode.args[i], route, currRoute + "-" + i, refName));
+ }
+ return absNode;
+ }
+}
+
+// Creates a node of type refName object with the appropriate number of arguments
+function createRefinement(refName) {
+ var newRef = new Fun(refName);
+ for (var i = 0, j = grammar.abstract.types[refName].args.length; i < j; i++) {
+ newRef.setArg(i, new Fun("?"));
+ }
+ return newRef;
+}
+
+// Gets the available wrappers for a node of type nodeType found in the grammar
+function getAvailableWrappers(nodeType, grammar, top) {
+ var wrappers = new Array();
+ for (var fun in grammar.abstract.types) {
+ for (var i = 0, j = grammar.abstract.types[fun].args.length; i < j; i++) {
+ if (top != "0") {
+ if (grammar.abstract.types[fun].args[i] == nodeType && grammar.abstract.types[fun].cat == nodeType) {
+ wrappers[wrappers.length] = new Array(fun, i);
+ break;
+ }
+ } else {
+ if (grammar.abstract.types[fun].args[i] == nodeType) {
+ wrappers[wrappers.length] = new Array(fun, i);
+ break;
+ }
+ }
+ }
+ }
+ return wrappers;
+}
+
+// Instantiates metavariables found in the tree abstractTree with refinements
+// selected at random from those found in the grammar
+function fillSubTree(abstractTree, grammar) {
+ while (!abstractTree.isComplete()) {
+ var nodeToRefine = getNextMetaFromAbstract(abstractTree, "0");
+ if (nodeToRefine) {
+ var refs = getAvailableRefinements(nodeToRefine, abstractTree, grammar);
+ if (refs.length == 0) {
+ var node = getNodeFromAbstract(abstractTree, nodeToRefine, "0");
+ if (node.type == "String" || node.type == "Int" || node.type == "Float") {
+ var newType = undefined;
+ var newTypeCat = node.type + "_Literal_";
+ switch(node.type)
+ {
+ case "String":
+ newType = "AutoString";
+ break;
+ case "Int":
+ newType = "8";
+ break;
+ case "Float":
+ newType = "8.0";
+ break;
+ }
+ if (node.type == "String") {
+ newTypeCat += "\"" + newType + "\"";
+ } else {
+ newTypeCat += newType;
+ }
+ if (!grammar.abstract.types[newTypeCat]) {
+ grammar.abstract.addType(newTypeCat, [], node.type);
+ for (var i in grammar.concretes) {
+ grammar.concretes[i].addRule(newTypeCat, function(cs){ return new Arr(new Str(newType));});
+ }
+ }
+ node.name = newTypeCat;
+ abstractTree = insertNode(abstractTree, nodeToRefine, "0", node);
+ abstractTree = grammar.abstract.annotate(abstractTree, grammar.abstract.startcat);
+ }
+ }
+ else {
+ var selectedRef = refs[Math.floor(refs.length * Math.random())];
+ abstractTree = refineAbstractTree(abstractTree, nodeToRefine, "0", selectedRef);
+ abstractTree = grammar.abstract.annotate(abstractTree, grammar.abstract.startcat);
+ }
+ }
+ }
+ return abstractTree;
+}
diff --git a/src/runtime/javascript/gflib-xhtml-voice.js b/src/runtime/javascript/gflib-xhtml-voice.js
new file mode 100644
index 000000000..fd8660100
--- /dev/null
+++ b/src/runtime/javascript/gflib-xhtml-voice.js
@@ -0,0 +1,54 @@
+/* Output */
+
+function sayText(text) {
+ document.voice_output_text = text;
+ activateForm("voice_output");
+}
+
+/* XHTML+Voice Utilities */
+
+function activateForm(formid) {
+ var form = document.getElementById(formid);
+ var e = document.createEvent("UIEvents");
+ e.initEvent("DOMActivate","true","true");
+ form.dispatchEvent(e);
+}
+
+
+/* DOM utilities */
+
+/* Gets the head element of the document. */
+function getHeadElement() {
+ var hs = document.getElementsByTagName("head");
+ if (hs.length == 0) {
+ var head = document.createElement("head");
+ document.documentElement.insertBefore(head, document.documentElement.firstChild);
+ return head;
+ } else {
+ return hs[0];
+ }
+}
+
+/* Gets the body element of the document. */
+function getBodyElement() {
+ var bs = document.getElementsByTagName("body");
+ if (bs.length == 0) {
+ var body = document.createElement("body");
+ document.documentElement.appendChild(body);
+ return body;
+ } else {
+ return bs[0];
+ }
+}
+
+/* Removes all the children of a node */
+function removeChildren(node) {
+ while (node.hasChildNodes()) {
+ node.removeChild(node.firstChild);
+ }
+}
+
+function setText(node, text) {
+ removeChildren(node);
+ node.appendChild(document.createTextNode(text));
+}
diff --git a/src/runtime/javascript/gflib.js b/src/runtime/javascript/gflib.js
new file mode 100644
index 000000000..728655469
--- /dev/null
+++ b/src/runtime/javascript/gflib.js
@@ -0,0 +1,1128 @@
+
+function GFGrammar(abstract, concretes) {
+ this.abstract = abstract;
+ this.concretes = concretes;
+}
+
+/* Translates a string from any concrete syntax to all concrete syntaxes.
+ Uses the start category of the grammar.
+*/
+GFGrammar.prototype.translate = function (input, fromLang, toLang) {
+ var outputs = new Object();
+ var fromConcs = this.concretes;
+ if (fromLang) {
+ fromConcs = new Object();
+ fromConcs[fromLang] = this.concretes[fromLang];
+ }
+ var toConcs = this.concretes;
+ if (toLang) {
+ toConcs = new Object();
+ toConcs[toLang] = this.concretes[toLang];
+ }
+ for (var c1 in fromConcs) {
+ var p = this.concretes[c1].parser;
+ if (p) {
+ var trees = p.parseString(input, this.abstract.startcat);
+ if (trees.length > 0) {
+ outputs[c1] = new Array();
+ for (var i in trees) {
+ outputs[c1][i] = new Object();
+ for (var c2 in toConcs) {
+ outputs[c1][i][c2] = this.concretes[c2].linearize(trees[i]);
+ }
+ }
+ }
+ }
+ }
+ return outputs;
+}
+
+
+/* ------------------------------------------------------------------------- */
+/* ----------------------------- LINEARIZATION ----------------------------- */
+/* ------------------------------------------------------------------------- */
+
+/* Extension to the String object */
+
+String.prototype.tag = "";
+String.prototype.setTag = function (tag) { this.tag = tag; };
+
+/* Abstract syntax trees */
+function Fun(name) {
+ this.name = name;
+ this.args = copy_arguments(arguments, 1);
+}
+Fun.prototype.print = function () { return this.show(0); } ;
+Fun.prototype.show = function (prec) {
+ if (this.isMeta()) {
+ if (isUndefined(this.type)) {
+ return '?';
+ } else {
+ var s = '?:' + this.type;
+ if (prec > 0) {
+ s = "(" + s + ")" ;
+ }
+ return s;
+ }
+ } else {
+ var s = this.name;
+ var cs = this.args;
+ for (var i in cs) {
+ s += " " + (isUndefined(cs[i]) ? "undefined" : cs[i].show(1));
+ }
+ if (prec > 0 && cs.length > 0) {
+ s = "(" + s + ")" ;
+ }
+ return s;
+ }
+};
+Fun.prototype.getArg = function (i) {
+ return this.args[i];
+};
+Fun.prototype.setArg = function (i,c) {
+ this.args[i] = c;
+};
+Fun.prototype.isMeta = function() {
+ return this.name == '?';
+} ;
+Fun.prototype.isComplete = function() {
+ if (this.isMeta()) {
+ return false;
+ } else {
+ for (var i in this.args) {
+ if (!this.args[i].isComplete()) {
+ return false;
+ }
+ }
+ return true;
+ }
+} ;
+Fun.prototype.isLiteral = function() {
+ return (/^[\"\d]/).test(this.name);
+} ;
+
+/* Concrete syntax terms */
+
+function Arr() { this.arr = copy_arguments(arguments, 0); }
+Arr.prototype.tokens = function() { return this.arr[0].tokens(); };
+Arr.prototype.sel = function(i) { return this.arr[i.toIndex()]; };
+Arr.prototype.setTag = function(tag) {
+ for (var i = 0, j = this.arr.length; i < j; i++) {
+ this.arr[i].setTag(tag);
+ }
+};
+
+function Seq() { this.seq = copy_arguments(arguments, 0); }
+Seq.prototype.tokens = function() {
+ var xs = new Array();
+ for (var i in this.seq) {
+ var ys = this.seq[i].tokens();
+ for (var j in ys) {
+ xs.push(ys[j]);
+ }
+ }
+ return xs;
+};
+Seq.prototype.setTag = function(tag) {
+ for (var i = 0, j = this.seq.length; i < j; i++) {
+ this.seq[i].setTag(tag);
+ }
+};
+
+function Variants() { this.variants = copy_arguments(arguments, 0); }
+Variants.prototype.tokens = function() { return this.variants[0].tokens(); };
+Variants.prototype.sel = function(i) { return this.variants[0].sel(i); };
+Variants.prototype.toIndex = function() { return this.variants[0].toIndex(); };
+Variants.prototype.setTag = function(tag) {
+ for (var i = 0, j = this.variants.length; i < j; i++) {
+ this.variants[i].setTag(tag);
+ }
+};
+
+function Rp(index,value) { this.index = index; this.value = value; }
+Rp.prototype.tokens = function() { return new Array(this.index.tokens()); };
+Rp.prototype.sel = function(i) { return this.value.arr[i.toIndex()]; };
+Rp.prototype.toIndex = function() { return this.index.toIndex(); };
+Rp.prototype.setTag = function(tag) { this.index.setTag(tag) };
+
+function Suffix(prefix,suffix) {
+ this.prefix = new String(prefix);
+ if (prefix.tag) { this.prefix.tag = prefix.tag; }
+ this.suffix = suffix;
+};
+Suffix.prototype.tokens = function() {
+ var xs = this.suffix.tokens();
+ for (var i in xs) {
+ xs[i] = new String(this.prefix + xs[i]);
+ xs[i].setTag(this.prefix.tag);
+ }
+ return xs;
+};
+Suffix.prototype.sel = function(i) { return new Suffix(this.prefix, this.suffix.sel(i)); };
+Suffix.prototype.setTag = function(tag) { if (!this.prefix.tag) { this.prefix.setTag(tag); } };
+
+function Meta() { }
+Meta.prototype.tokens = function() {
+ var newString = new String("?");
+ newString.setTag(this.tag);
+ return new Array(newString);
+};
+Meta.prototype.toIndex = function() { return 0; };
+Meta.prototype.sel = function(i) { return this; };
+Meta.prototype.setTag = function(tag) { if (!this.tag) { this.tag = tag; } };
+
+function Str(value) { this.value = value; }
+Str.prototype.tokens = function() {
+ var newString = new String(this.value);
+ newString.setTag(this.tag);
+ return new Array(newString);
+};
+Str.prototype.setTag = function(tag) { if (!this.tag) { this.tag = tag; } };
+
+function Int(value) { this.value = value; }
+Int.prototype.tokens = function() {
+ var newString = new String(this.value.toString());
+ newString.setTag(this.tag);
+ return new Array(newString);
+};
+Int.prototype.toIndex = function() { return this.value; };
+Int.prototype.setTag = function(tag) { if (!this.tag) { this.tag = tag; } };
+
+/* Type annotation */
+
+function GFAbstract(startcat, types) {
+ this.startcat = startcat;
+ this.types = types;
+}
+GFAbstract.prototype.addType = function(fun, args, cat) {
+ this.types[fun] = new Type(args, cat);
+} ;
+GFAbstract.prototype.getArgs = function(fun) {
+ return this.types[fun].args;
+}
+GFAbstract.prototype.getCat = function(fun) {
+ return this.types[fun].cat;
+};
+GFAbstract.prototype.annotate = function(tree, type) {
+ if (tree.name == '?') {
+ tree.type = type;
+ } else {
+ var typ = this.types[tree.name];
+ for (var i in tree.args) {
+ this.annotate(tree.args[i], typ.args[i]);
+ }
+ }
+ return tree;
+} ;
+GFAbstract.prototype.handleLiterals = function(tree, type) {
+ if (tree.name != '?') {
+ if (type == "String" || type == "Int" || type == "Float") {
+ tree.name = type + "_Literal_" + tree.name;
+ } else {
+ var typ = this.types[tree.name];
+ for (var i in tree.args) {
+ this.handleLiterals(tree.args[i], typ.args[i]);
+ }
+ }
+ }
+ return tree;
+} ;
+/* Hack to get around the fact that our SISR doesn't build real Fun objects. */
+GFAbstract.prototype.copyTree = function(x) {
+ var t = new Fun(x.name);
+ if (!isUndefined(x.type)) {
+ t.type = x.type;
+ }
+ var cs = x.args;
+ if (!isUndefined(cs)) {
+ for (var i in cs) {
+ t.setArg(i, this.copyTree(cs[i]));
+ }
+ }
+ return t;
+} ;
+GFAbstract.prototype.parseTree = function(str, type) {
+ return this.annotate(this.parseTree_(str.match(/[\w\'\.\"]+|\(|\)|\?|\:/g), 0), type);
+} ;
+GFAbstract.prototype.parseTree_ = function(tokens, prec) {
+ if (tokens.length == 0 || tokens[0] == ")") { return null; }
+ var t = tokens.shift();
+ if (t == "(") {
+ var tree = this.parseTree_(tokens, 0);
+ tokens.shift();
+ return tree;
+ } else if (t == '?') {
+ var tree = this.parseTree_(tokens, 0);
+ return new Fun('?');
+ } else {
+ var tree = new Fun(t);
+ if (prec == 0) {
+ var c, i;
+ for (i = 0; (c = this.parseTree_(tokens, 1)) !== null; i++) {
+ tree.setArg(i,c);
+ }
+ }
+ return tree;
+ }
+} ;
+
+function Type(args, cat) {
+ this.args = args;
+ this.cat = cat;
+}
+
+/* Linearization */
+
+function GFConcrete(flags, rules, parser) {
+ this.flags = flags;
+ this.rules = rules;
+ if (parser) {
+ this.parser = parser;
+ } else {
+ this.parser = undefined;
+ }
+}
+GFConcrete.prototype.rule = function (name, cs) {
+ var r = this.rules[name];
+ if (r) {
+ return this.rules[name](cs);
+ } else {
+ window.alert("Missing rule " + name);
+ }
+};
+GFConcrete.prototype.addRule = function (name, f) { this.rules[name] = f; };
+GFConcrete.prototype.lindef = function (cat, v) { return this.rules[cat]([new Str(v)]); } ;
+GFConcrete.prototype.linearize = function (tree) {
+ return this.unlex(this.linearizeToTerm(tree).tokens());
+};
+GFConcrete.prototype.linearizeToTerm = function (tree) {
+ if (tree.isMeta()) {
+ if (isUndefined(tree.type)) {
+ return new Meta();
+ } else {
+ return this.lindef(tree.type, tree.name);
+ }
+ } else {
+ var cs = new Array();
+ for (var i in tree.args) {
+ cs.push(this.linearizeToTerm(tree.args[i]));
+ }
+ if (tree.isLiteral()) {
+ return new Arr(new Str(tree.name));
+ } else {
+ return this.rule(tree.name, cs);
+ }
+ }
+};
+GFConcrete.prototype.unlex = function (ts) {
+ if (ts.length == 0) {
+ return "";
+ }
+
+ var noSpaceAfter = /^[\(\-\[]/;
+ var noSpaceBefore = /^[\.\,\?\!\)\:\;\-\]]/;
+
+ var s = "";
+ for (var i = 0; i < ts.length; i++) {
+ var t = ts[i];
+ var after = i < ts.length-1 ? ts[i+1] : null;
+ s += t;
+ if (after != null && !t.match(noSpaceAfter)
+ && !after.match(noSpaceBefore)) {
+ s += " ";
+ }
+ }
+ return s;
+};
+GFConcrete.prototype.tagAndLinearize = function (tree) {
+ return this.tagAndLinearizeToTerm(tree, "0").tokens();
+};
+GFConcrete.prototype.tagAndLinearizeToTerm = function (tree, route) {
+ if (tree.isMeta()) {
+ if (isUndefined(tree.type)) {
+ var newMeta = new Meta();
+ newMeta.setTag(route);
+ return newMeta;
+ } else {
+ var newTerm = this.lindef(tree.type, tree.name);
+ newTerm.setTag(route);
+ return newTerm;
+ }
+ } else {
+ var cs = new Array();
+ for (var i in tree.args) {
+ cs.push(this.tagAndLinearizeToTerm(tree.args[i], route + "-" + i));
+ }
+ var newTerm = this.rule(tree.name, cs);
+ newTerm.setTag(route);
+ return newTerm;
+ }
+};
+
+/* Utilities */
+
+/* from Remedial JavaScript by Douglas Crockford, http://javascript.crockford.com/remedial.html */
+function isString(a) { return typeof a == 'string'; }
+function isArray(a) { return a && typeof a == 'object' && a.constructor == Array; }
+function isUndefined(a) { return typeof a == 'undefined'; }
+function isBoolean(a) { return typeof a == 'boolean'; }
+function isNumber(a) { return typeof a == 'number' && isFinite(a); }
+function isFunction(a) { return typeof a == 'function'; }
+
+function dumpObject (obj) {
+ if (isUndefined(obj)) {
+ return "undefined";
+ } else if (isString(obj)) {
+ return '"' + obj.toString() + '"'; // FIXME: escape
+ } else if (isBoolean(obj) || isNumber(obj)) {
+ return obj.toString();
+ } else if (isArray(obj)) {
+ var x = "[";
+ for (var i in obj) {
+ x += dumpObject(obj[i]);
+ if (i < obj.length-1) {
+ x += ",";
+ }
+ }
+ return x + "]";
+ } else {
+ var x = "{";
+ for (var y in obj) {
+ x += y + "=" + dumpObject(obj[y]) + ";" ;
+ }
+ return x + "}";
+ }
+}
+
+
+function copy_arguments(args, start) {
+ var arr = new Array();
+ for (var i = 0; i < args.length - start; i++) {
+ arr[i] = args[i + start];
+ }
+ return arr;
+}
+
+/* ------------------------------------------------------------------------- */
+/* -------------------------------- PARSING -------------------------------- */
+/* ------------------------------------------------------------------------- */
+
+
+function Parser(startcat, rules, cats) {
+ this.startcat = startcat;
+ this.rules = rules;
+ this.cats = cats;
+}
+Parser.prototype.showRules = function () {
+ var ruleStr = new Array();
+ ruleStr.push("");
+ for (i = 0, j = this.rules.length; i < j; i++) {
+ ruleStr.push(this.rules[i].show());
+ }
+ return ruleStr.join("");
+};
+Parser.prototype.parseString = function (string, cat) {
+ var tokens = string.split(" ");
+ // remove empty tokens
+ for (var i = tokens.length - 1; i >= 0; i--) {
+ if (tokens[i] == "") { tokens.splice(i, 1); }
+ }
+ chart = new Chart(true);
+ predict(this.rules, tokens);
+ while (chart.updated) {
+ chart.updated = false;
+ completeAndConvert();
+ scan();
+ combine();
+ }
+ var catToParse = this.startcat;
+ if (cat) { catToParse = cat; }
+ var goalRange = new Range(0, tokens.length);
+ if (tokens.length == 1 && tokens[0] == "") { goalRange = new EmptyRange(); }
+ var activeEdges = filterActiveEdges();
+ var trees = new Array();
+ for (var i = 0, j = this.cats[catToParse].length; i < j; i++) {
+ if (foundTarget(this.cats[catToParse][i], new Array(new Array(goalRange)))) {
+ trees = trees.concat(extractTrees(this.cats[catToParse][i], new Array(new Array(goalRange)), activeEdges, ""));
+ }
+ }
+ for (var i = trees.length - 1; i >= 0; i--) {
+ if (trees[i] == undefined) { trees.splice(i, 1); }
+ }
+ return trees;
+};
+
+// Rule Object Definition
+
+function Rule(cat, profile, args, linRec) {
+ this.cat = cat;
+ this.profile = profile;
+ this.args = args;
+ this.linRec = linRec;
+}
+Rule.prototype.show = function () {
+ var recStr = new Array();
+ recStr.push(this.cat, " -> ", this.profile.show(), " [", this.args, "] = ", showLinRec(this.linRec, ""));
+ return recStr.join("");
+};
+
+// Profile definitions
+
+// Function application
+// The function (name) is applied to its arguments (args)
+function FunApp(name, args) {
+ this.id = "FunApp";
+ this.name = name;
+ this.args = args.slice(0);
+}
+FunApp.prototype.show = function () {
+ var funAppStr = new Array();
+ funAppStr.push("(", this.name);
+ for (var i = 0, j = this.args.length; i < j; i++) {
+ funAppStr.push(this.args[i].show());
+ }
+ funAppStr.push(")");
+ return funAppStr.join(" ");
+};
+
+// Literal
+function Lit(name) {
+ this.id = "Lit";
+ this.name = name;
+}
+Lit.prototype.show = function () { return this.name; };
+
+// Metavariable
+function MetaVar() { this.id = "MetaVar"; }
+MetaVar.prototype.show = function () { return "?"; };
+
+// Argument
+function Arg(i) {
+ this.id = "Arg";
+ this.name = "_";
+ this.i = i;
+}
+Arg.prototype.show = function () {
+ var argStr = new Array();
+ argStr.push(this.id, "(", this.i, ")");
+ return argStr.join("");
+};
+
+// Unification
+// The arguments (args) must be unified
+function Unify(args){
+ this.id = "Unify";
+ this.args = args.slice(0);
+}
+Unify.prototype.show = function () {
+ var unifyStr = new Array();
+ unifyStr.push("(", this.id);
+ for (var i = 0, j = this.args.length; i < j; i++) {
+ unifyStr.push(this.args[i].show());
+ }
+ unifyStr.push(")");
+ return unifyStr.join(" ");
+};
+
+// Definition of symbols present in linearization records
+
+// Object to represent argument projections in grammar rules
+function ArgProj(i, label) {
+ this.id = "argProj";
+ this.i = i;
+ this.label = label;
+}
+ArgProj.prototype.getId = function () { return this.id; };
+ArgProj.prototype.getArgNum = function () { return this.i };
+ArgProj.prototype.show = function () {
+ var argStr = new Array();
+ argStr.push(this.i, this.label);
+ return argStr.join(".");
+};
+ArgProj.prototype.isEqual = function (obj) {
+ return (this.id == obj.id && this.i == obj.i && this.label == obj.label);
+}
+
+// Object to represent terminals in grammar rules
+function Terminal (str) {
+ this.id = "terminal";
+ this.str = str;
+}
+Terminal.prototype.getId = function () { return this.id; };
+Terminal.prototype.show = function () {
+ var terminalStr = new Array();
+ terminalStr.push('"', this.str, '"');
+ return terminalStr.join("");
+};
+Terminal.prototype.isEqual = function (obj) {
+ return (this.id == obj.id && this.str == obj.str);
+}
+
+// Object to represent ranges in grammar rules
+function Range (i, j) {
+ this.id = "range";
+ this.i = i;
+ this.j = j;
+}
+Range.prototype.getId = function () { return this.id; };
+Range.prototype.show = function () {
+ var terminalStr = new Array();
+ terminalStr.push("(", this.i, ",", this.j, ")");
+ return terminalStr.join("");
+};
+Range.prototype.isEqual = function (obj) {
+ return (this.id == obj.id && this.i == obj.i && this.j == obj.j);
+}
+
+// Object to represent the empty range in grammar rules
+function EmptyRange () {
+ this.id = "emptyRange";
+}
+EmptyRange.prototype.getId = function () { return this.id; };
+EmptyRange.prototype.show = function () { return "emptyRange" };
+EmptyRange.prototype.isEqual = function (obj) {
+ return (this.id == obj.id);
+}
+
+// Chart Object Definition
+function Chart(updated) {
+ this.passive = new Array();
+ this.active = new Array();
+ this.updated = updated;
+}
+Chart.prototype.show = function () {
+ var chartStr = new Array();
+ chartStr.push("(", this.showPassive(), ", ", this.showActive(), ")");
+ return chartStr.join("");
+};
+Chart.prototype.addPassiveEdge = function (cat, linRec) {
+ if (!this.passive[cat] || !this.passive[cat].length) {
+ this.passive[cat] = new Array();
+ }
+ this.passive[cat].push(linRec);
+};
+Chart.prototype.isPassiveElem = function (cat, linRec) {
+ if (this.passive[cat]) {
+ for (var i = 0, j = this.passive[cat].length; i < j; i++) {
+ if (linRecsAreEqual(this.passive[cat][i], linRec)) {
+ return true;
+ }
+ }
+ }
+ return false;
+};
+Chart.prototype.showPassive = function () {
+ var edgesStr = new Array();
+ edgesStr.push("[ ");
+ for (var cat in this.passive) {
+ for (var i = 0, j = this.passive[cat].length; i < j; i++) {
+ edgesStr.push("( ", cat, ", ", showLinRec(this.passive[cat][i], ""), ")");
+ if (i != j - 1) { edgesStr.push(", "); };
+ }
+ edgesStr.push(", ");
+ }
+ edgesStr.push(" ]");
+ return edgesStr.join("");
+ return edgesStr.join("") + "<br />";
+};
+Chart.prototype.addActiveEdge = function (cat, edge) {
+ if (!this.active[cat] || !this.active[cat].length) {
+ this.active[cat] = new Array();
+ }
+ this.active[cat].push(edge);
+};
+Chart.prototype.isActiveElem = function (cat, edge) {
+ if (this.active[cat]) {
+ for (var i = 0, j = this.active[cat].length; i < j; i++) {
+ var currentEdge = this.active[cat][i];
+ if (currentEdge.name == edge.name && (areArgsEqual(currentEdge.args, edge.args)) &&
+ currentEdge.currLabel == edge.currLabel && currentEdge.currLin.isEqual(edge.currLin) &&
+ linRecsAreEqual(currentEdge.linFound, edge.linFound) && linRowsAreEqual(currentEdge.remLin, edge.remLin) &&
+ linRecsAreEqual(currentEdge.remLinRows, edge.remLinRows) &&
+ arraysOfLinRecsAreEqual(currentEdge.children, edge.children)) {
+ return true;
+ }
+ }
+ }
+ return false;
+};
+Chart.prototype.showActive = function () {
+ var edgesStr = new Array()
+ edgesStr.push("[ ");
+ for (var cat in this.active) {
+ for (var i = 0, j = this.active[cat].length; i < j; i++) {
+ edgesStr.push("( ", this.active[cat][i].show(), " )");
+ if (i != j - 1) { edgesStr.push(", "); };
+ }
+ edgesStr.push(", ");
+ }
+ edgesStr.push(" ]");
+ return edgesStr.join("");
+};
+
+// Object to represent the active edges in a chart
+function ActiveEdge(profile, cat, name, args, linFound, currLabel, currLin, remLin, remLinRows, children) {
+ this.profile = profile;
+ this.cat = cat;
+ this.name = name;
+ this.args = args;
+ this.linFound = linFound;
+ this.currLabel = currLabel;
+ this.currLin = currLin;
+ this.remLin = remLin;
+ this.remLinRows = remLinRows;
+ this.children = children.slice(0);
+}
+ActiveEdge.prototype.show = function () {
+ var linRecStr = new Array();
+ linRecStr.push(this.profile.show(), ", ", this.cat, ", ", this.name, ", [ ", this.args, " ], ", showLinRec(this.linFound, ""),
+ ", ", this.currLabel, ", ", this.currLin.show(), ", ", showLinRow(this.remLin, " ++ "),
+ ", ", showLinRec(this.remLinRows, ""), ", [ ");
+ for (var i = 0, j = this.children.length; i < j; i++) {
+ linRecStr.push(showLinRec(this.children[i], ""));
+ if (i != j - 1) { linRecStr.push(", "); };
+ }
+ linRecStr.push(" ]");
+ return linRecStr.join("");
+};
+
+function areArgsEqual(args1, args2) {
+ if (args1.length == args1.length && args1.join() == args2.join()) {
+ return true
+ }
+ return false;
+}
+
+// Functions to manipulate linearization records
+
+// Returns a string representation of a linearization row
+function showLinRow(linRow, separator) {
+ var linRowStr = new Array();
+ linRowStr.push(" [ ");
+ for (var i = 0, j = linRow.length; i < j; i ++) {
+ linRowStr.push(linRow[i].show());
+ if (i != j - 1) { linRowStr.push(separator) };
+ }
+ linRowStr.push(" ] ");
+ return linRowStr.join("");
+}
+
+// Returns a string representation of a linearization record
+function showLinRec(linRec, separator) {
+ var linRecStr = new Array();
+ linRecStr.push(" [ ");
+ for (var i = 0, j = linRec.length; i < j; i ++) {
+ linRecStr.push(showLinRow(linRec[i], " ++ "));
+ if (i != j - 1) { linRecStr.push(separator); };
+ }
+ linRecStr.push(" ] ");
+ return linRecStr.join("");
+}
+
+// Checks if two linearization rows are equal
+function linRowsAreEqual(linRow1, linRow2) {
+ if (linRow1.length == linRow2.length) {
+ for (var i = 0, j = linRow1.length; i < j; i++) {
+ if (linRow1[i].id && linRow2[i].id && !linRow1[i].isEqual(linRow2[i])) {
+ return false;
+ }
+ }
+ return true;
+ }
+ return false;
+}
+
+// Checks if two linearization records are equal
+function linRecsAreEqual(linRec1, linRec2) {
+ if (linRec1.length == linRec2.length) {
+ for (var i = 0, j = linRec1.length; i < j; i++) {
+ if (!linRowsAreEqual(linRec1[i], linRec2[i])) { return false; }
+ }
+ return true;
+ }
+ return false;
+}
+
+// Checks if two arrays of linearization records are equal
+function arraysOfLinRecsAreEqual(array1, array2) {
+ if (array1.length == array2.length) {
+ for (var i = 0, j = array1.length; i < j; i++) {
+ if (!linRecsAreEqual(array1[i], array2[i])) { return false; }
+ }
+ return true;
+ }
+ return false;
+}
+
+// Functions to manipulate ranges (restriction and concatenation)
+
+// Concatenates two ranges
+function rangeConcatLin (lin1, lin2) {
+ if (lin1.id == "range" && lin2.id == "range") {
+ if (lin1.j == lin2.i) { return (new Range(lin1.i, lin2.j)) }
+ } else if (lin1.id == "range" && lin2.id == "emptyRange") { return lin1; }
+ else if (lin1.id == "emptyRange" && lin2.id == "range") { return lin2; }
+ else if (lin1.id == "emptyRange" && lin2.id == "emptyRange") { return lin1; }
+ return undefined;
+}
+
+// Performs range concatenation on a linearization row
+function rangeConcatLins (lins) {
+ var newLins = new Array();
+ newLins.push(lins.shift());
+ while (lins.length > 0) {
+ if (!newLins[newLins.length - 1]) { return new Array(); }
+ if (newLins[newLins.length - 1].id == "range" && lins[0].id == "range") {
+ var rangeConcat = rangeConcatLin(newLins.pop(), lins[0]);
+ if (typeof rangeConcat == 'undefined') { return new Array(); }
+ newLins.push(rangeConcat);
+ lins.shift();
+ } else {
+ newLins.push(lins.shift());
+ }
+ }
+ return newLins;
+}
+
+// Performs range restriction on an element of a linearization row
+// while keeping track of the tokens that have been used
+function rangeRestLinTerm(tokens, lin, rangesNotConsumed) {
+ if (lin.id == "argProj") { return new Array(lin); }
+ else if (lin.id == "terminal") {
+ var ranges = new Array();
+ for (var i = 0, j = tokens.length; i < j; i++) {
+ if (tokens[i] == lin.str) {
+ ranges.push(new Range(i, i + 1));
+ rangesNotConsumed[i] = undefined;
+ }
+ }
+ if (ranges.length == 0) {
+ return undefined;
+ } else {
+ return ranges;
+ }
+ }
+ else { return new Array(); }
+}
+
+// Performs range restriction on a linearization record
+// while keeping track of the tokens that have been used
+function rangeRestRecTerm(linRec, tokens, rangesNotConsumed) {
+ var ranges = new Array();
+ for (var i = 0, j = linRec.length; i < j; i++) {
+ var rangeRestLins = new Array();
+ for (var k = 0, l = linRec[i].length; k < l; k++) {
+ rangeRestLins.push(rangeRestLinTerm(tokens, linRec[i][k], rangesNotConsumed));
+ }
+ var combinedLins = combineLins(rangeRestLins);
+ if (typeof combinedLins != 'undefined') {
+ var filteredLins = new Array();
+ if (combinedLins.length == 0) {
+ filteredLins.push(new Array());
+ } else {
+ for (var m = 0, n = combinedLins.length; m < n; m++) {
+ var temp = rangeConcatLins(combinedLins[m]);
+ if (temp.length != 0) {
+ filteredLins.push(temp);
+ }
+ }
+ }
+ ranges.push(filteredLins);
+ } else { ranges.push(undefined); }
+ }
+ for (var k = 0, l = ranges.length; k < l; k++) {
+ if (ranges[k] == undefined) { return undefined; }
+ }
+ return combineLins(ranges);
+}
+
+// Returns the combinations of the elements of an array of arrays
+function combineLins(linss) {
+ if (linss.length > 0) {
+ var combinedLins = new Array();
+ var lins = linss.shift();
+ if (lins) {
+ if (lins.length != 0) {
+ var tail = combineLins(linss);
+ if (typeof tail == 'undefined') { return undefined; }
+ for (var i = 0, j = lins.length; i < j; i++) {
+ var head = new Array();
+ head.push(lins[i]);
+ if (tail.length == 0) { combinedLins.push(head); }
+ else {
+ for (var k = 0, l = tail.length; k < l; k++) {
+ combinedLins.push(head.concat(tail[k]));
+ }
+ }
+ }
+ } else { return new Array(); }
+ } else { return undefined; }
+ return combinedLins;
+ } else { return new Array(); }
+}
+
+// Inference Rules
+
+function predict(rules, tokens) {
+ var rangesNotConsumed = genRanges(tokens.length);
+ for (var i = 0, j = rules.length; i < j; i++) {
+ var currentRule = rules[i];
+ var linRec = rangeRestRecTerm(currentRule.linRec, tokens, rangesNotConsumed);
+ if (linRec) {
+ for (var k = 0, l = linRec.length; k < l; k++) {
+ var currentRow = linRec[k].shift();
+ var remlinRows = linRec[k];
+ var children = new Array();
+ for (var m = 0, n = currentRule.args.length; m < n; m++) {
+ children.push(new Array());
+ }
+ var newActive = new ActiveEdge(currentRule.profile, currentRule.cat, currentRule.profile.name, currentRule.args, new Array(), 0, new EmptyRange(), currentRow, remlinRows, children);
+ if (!chart.isActiveElem(currentRule.cat, newActive)) {
+ chart.addActiveEdge(currentRule.cat, newActive);
+ chart.updated = true;
+ }
+ }
+ }
+ }
+ for (var i = 0, j = rangesNotConsumed.length; i < j; i++) {
+ if (rangesNotConsumed[i] != undefined) {
+ var cat = undefined;
+ if (isNaN(tokens[i])) {
+ cat = "-1";
+ } else if (tokens[i].lastIndexOf(".") == -1) {
+ cat = "-2";
+ } else {
+ cat = "-3";
+ }
+ var lit = undefined;
+ if (cat == "-1") {
+ lit = "\"" + tokens[i] + "\"";
+ } else {
+ lit = tokens[i];
+ }
+ var newActive = new ActiveEdge(new Lit(lit), cat, tokens[i], new Array(), new Array(), 0, new Range(i, i + 1), new Array(), new Array(), new Array());
+ if (!chart.isActiveElem(cat, newActive)) {
+ chart.addActiveEdge(cat, newActive);
+ chart.updated = true;
+ }
+ }
+ }
+}
+
+function genRanges(inputLength) {
+ var ranges = new Array();
+ for (var i = 0; i < inputLength; i++) {
+ ranges.push(i);
+ }
+ return ranges;
+}
+
+function completeAndConvert() {
+ for (var cat in chart.active) {
+ var currentEdge = chart.active[cat];
+ for (var i = 0, j = currentEdge.length; i < j; i++) {
+ if (currentEdge[i].remLin.length == 0) {
+ if (currentEdge[i].remLinRows.length == 0) {
+ var linFound = currentEdge[i].linFound.slice(0);
+ linFound.push(new Array(currentEdge[i].currLin));
+ if (!chart.isPassiveElem(cat, linFound)) {
+ chart.addPassiveEdge(cat, linFound);
+ chart.updated = true;
+ }
+ } else {
+ var linFound = currentEdge[i].linFound.slice(0);
+ linFound.push(new Array(currentEdge[i].currLin));
+ var remLinRows = currentEdge[i].remLinRows.slice(0);
+ var currentRow = remLinRows.shift();
+ var newActive = new ActiveEdge(currentEdge[i].profile, cat, currentEdge[i].name, currentEdge[i].args, linFound, linFound.length, new EmptyRange(), currentRow, remLinRows, currentEdge[i].children);
+ if (!chart.isActiveElem(cat, newActive)) {
+ chart.active[cat].push(newActive);
+ chart.updated = true;
+ }
+ }
+ }
+ }
+ }
+}
+
+function scan() {
+ for (var cat in chart.active) {
+ var currentEdge = chart.active[cat];
+ for (var i = 0, j = currentEdge.length; i < j; i++) {
+ if (currentEdge[i].remLin.length > 0 && currentEdge[i].remLin[0].id == "range") {
+ var newRange = rangeConcatLin(currentEdge[i].currLin, currentEdge[i].remLin[0]);
+ if (typeof newRange != 'undefined') {
+ var remLin = currentEdge[i].remLin.slice(0);
+ remLin.shift();
+ var newActive = new ActiveEdge(currentEdge[i].profile, cat, currentEdge[i].name, currentEdge[i].args, currentEdge[i].linFound, currentEdge[i].currLabel, newRange, remLin, currentEdge[i].remLinRows, currentEdge[i].children);
+ if (!chart.isActiveElem(cat, newActive)) {
+ chart.active[cat].push(newActive);
+ chart.updated = true;
+ }
+ }
+ }
+ }
+ }
+}
+
+function combine() {
+ for (var cat in chart.active) {
+ for (var i = 0; i < chart.active[cat].length; i++) {
+ var currentEdge = chart.active[cat][i];
+ if (currentEdge.remLin.length && currentEdge.remLin[0].id == "argProj") {
+ var argNumber = currentEdge.remLin[0].i;
+ var catToCombine = currentEdge.args[argNumber];
+ if (chart.passive[catToCombine]) {
+ for (var k = 0, l = chart.passive[catToCombine].length; k < l; k++) {
+ var currentPassive = chart.passive[catToCombine][k];
+ var remLin = currentEdge.remLin.slice(0);
+ var linRow = currentPassive[remLin[0].label];
+ if (typeof linRow != 'undefined') {
+ var newLinRow = linRow.slice(0);
+ if (currentEdge.children[argNumber].length == 0) {
+ var newRange = rangeConcatLin(currentEdge.currLin, newLinRow.shift());
+ if (typeof newRange != 'undefined') {
+ remLin.shift();
+ var children = currentEdge.children.slice(0);
+ children[argNumber] = currentPassive.slice(0);
+ var newActive = new ActiveEdge(currentEdge.profile, currentEdge.cat, currentEdge.name, currentEdge.args, currentEdge.linFound, currentEdge.currLabel, newRange, remLin, currentEdge.remLinRows, children);
+ if (!chart.isActiveElem(cat, newActive)) {
+ chart.active[cat].push(newActive);
+ chart.updated = true;
+ }
+ }
+ } else {
+ var child = currentEdge.children[argNumber];
+ if (linRecsAreEqual(currentPassive, child)) {
+ var newRange = rangeConcatLin(currentEdge.currLin, newLinRow.shift());
+ if (typeof newRange != 'undefined') {
+ remLin.shift();
+ var children = currentEdge.children.slice(0);
+ children[argNumber] = currentPassive.slice(0);
+ var newActive = new ActiveEdge(currentEdge.profile, currentEdge.cat, currentEdge.name, currentEdge.args, currentEdge.linFound, currentEdge.currLabel, newRange, remLin, currentEdge.remLinRows, children);
+ if (!chart.isActiveElem(cat, newActive)) {
+ chart.active[cat].push(newActive);
+ chart.updated = true;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+// Checks if the parsing goal is in the chart
+function foundTarget(cat, linRec) {
+ if (chart.passive[cat]) {
+ for (var i = 0, j = chart.passive[cat].length; i < j; i++) {
+ if (linRecsAreEqual(linRec, chart.passive[cat][i])) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+// Filters the active edges that are relevant for tree extraction
+function filterActiveEdges() {
+ var activeEdges = new Array();
+ for (var cat in chart.active) {
+ activeEdges[cat] = new Array();
+ for (var i = 0, j = chart.active[cat].length; i < j; i++) {
+ var currentEdge = chart.active[cat][i];
+ if (currentEdge.remLin.length == 0 && currentEdge.remLinRows.length == 0) {
+ var linFound = currentEdge.linFound.slice(0);
+ linFound.push(new Array(currentEdge.currLin));
+ var newActive = new ActiveEdge(currentEdge.profile, currentEdge.cat, currentEdge.name, currentEdge.args, linFound, "", "", "", "", currentEdge.children);
+ activeEdges[cat].push(newActive);
+ }
+ }
+ }
+ return activeEdges;
+}
+
+// Extracts the parse trees from the chart
+function extractTrees(cat, linRec, activeEdges, currentTree) {
+ var trees = new Array();
+ for (var i = 0, j = activeEdges[cat].length; i < j; i++) {
+ var currentEdge = activeEdges[cat][i];
+ var currentNode = "(" + cat + "-" + i + ")";
+ if (currentTree.indexOf(currentNode) == -1 && cat == currentEdge.cat && linRecsAreEqual(linRec, currentEdge.linFound)) {
+ var subTrees = new Array();
+ for (var k = 0, l = currentEdge.children.length; k < l; k++) {
+ subTrees.push(extractTrees(currentEdge.args[k], currentEdge.children[k].slice(0), activeEdges, currentTree + currentNode));
+ }
+ var combinedSubTrees = combineLins(subTrees);
+ if (combinedSubTrees) {
+ if (currentEdge.children.length == 0) { combinedSubTrees.push(new Array()); }
+ for (var m = 0, n = combinedSubTrees.length; m < n; m++) {
+ var tree = buildTree(currentEdge.profile, combinedSubTrees[m]);
+ if (tree) {
+ trees.push(tree);
+ }
+ }
+ }
+ }
+ }
+ if (trees.length == 0) {
+ return undefined;
+ } else {
+ return trees;
+ }
+}
+
+// Builds a tree according to the profile
+function buildTree(profile, args) {
+ switch(profile.id)
+ {
+ case "FunApp":
+ var tree = new Fun(profile.name);
+ for (var i = 0, j = profile.args.length; i < j; i++) {
+ var subTree = buildTree(profile.args[i], args);
+ if (subTree) {
+ tree.setArg(i, subTree);
+ } else {
+ return undefined;
+ }
+ }
+ return tree;
+ case "Lit":
+ return new Fun(profile.name);
+ case "MetaVar":
+ return new Fun("?");
+ case "Arg":
+ return args[profile.i];
+ case "Unify":
+ var subTrees = new Array();
+ for (var i = 0, j = profile.args.length; i < j; i++) {
+ subTrees.push(buildTree(profile.args[i], args))
+ }
+ return unifySubTrees(subTrees);
+ }
+}
+
+// Tree unification functions
+function unifySubTrees(subTrees) {
+ var t = subTrees[0];
+ for (var i = 1, j = subTrees.length; i < j; i++) {
+ t = unify(t, subTrees[i]);
+ if (!t) { return undefined; }
+ }
+ return t;
+}
+
+function unify(a, b) {
+ if (a.isMeta()) { return b };
+ if (b.isMeta()) { return a };
+ if (a.name == b.name && a.args.length == b.args.length) {
+ for (var i = 0, j = a.args.length; i < j; i++) {
+ if (!unify(a.args[i], b.args[i])) { return undefined; }
+ }
+ return a
+ };
+ return undefined;
+}
diff --git a/src/runtime/javascript/grammar.js b/src/runtime/javascript/grammar.js
new file mode 100644
index 000000000..69175bba4
--- /dev/null
+++ b/src/runtime/javascript/grammar.js
@@ -0,0 +1 @@
+var Food = new GFGrammar(new GFAbstract("Phrase",{Boring: new Type([], "Quality"), Cheese: new Type([], "Kind"), Delicious: new Type([], "Quality"), Expensive: new Type([], "Quality"), Fish: new Type([], "Kind"), Fresh: new Type([], "Quality"), Is: new Type(["Item", "Quality"], "Phrase"), Italian: new Type([], "Quality"), QKind: new Type(["Quality", "Kind"], "Kind"), That: new Type(["Kind"], "Item"), This: new Type(["Kind"], "Item"), Very: new Type(["Quality"], "Quality"), Warm: new Type([], "Quality"), Wine: new Type([], "Kind")}),{FoodEng: new GFConcrete({},{Boring: function(cs){return new Arr(new Str("boring"));}, Cheese: function(cs){return new Arr(new Str("cheese"));}, Delicious: function(cs){return new Arr(new Str("delicious"));}, Expensive: function(cs){return new Arr(new Str("expensive"));}, Fish: function(cs){return new Arr(new Str("fish"));}, Fresh: function(cs){return new Arr(new Str("fresh"));}, Is: function(cs){return new Arr(new Seq(cs[0].sel(new Int(0)), new Str("is"), cs[1].sel(new Int(0))));}, Italian: function(cs){return new Arr(new Str("Italian"));}, QKind: function(cs){return new Arr(new Seq(cs[0].sel(new Int(0)), cs[1].sel(new Int(0))));}, That: function(cs){return new Arr(new Seq(new Str("that"), cs[0].sel(new Int(0))));}, This: function(cs){return new Arr(new Seq(new Str("this"), cs[0].sel(new Int(0))));}, Very: function(cs){return new Arr(new Seq(new Str("very"), cs[0].sel(new Int(0))));}, Warm: function(cs){return new Arr(new Str("warm"));}, Wine: function(cs){return new Arr(new Str("wine"));}, Item: function(cs){return new Arr(cs[0]);}, Kind: function(cs){return new Arr(cs[0]);}, Phrase: function(cs){return new Arr(cs[0]);}, Quality: function(cs){return new Arr(cs[0]);}, "Int": function(cs){return new Arr(cs[0]);}, "Float": function(cs){return new Arr(cs[0]);}, "String": function(cs){return new Arr(cs[0]);}}, new Parser("Phrase",[new Rule(1, new FunApp("Boring",[]),[],[[new Terminal("boring")]]), new Rule(1, new FunApp("Delicious",[]),[],[[new Terminal("delicious")]]), new Rule(1, new FunApp("Expensive",[]),[],[[new Terminal("expensive")]]), new Rule(1, new FunApp("Fresh",[]),[],[[new Terminal("fresh")]]), new Rule(1, new FunApp("Italian",[]),[],[[new Terminal("Italian")]]), new Rule(1, new FunApp("Very",[new Arg(0)]),[1],[[new Terminal("very"), new ArgProj(0, 0)]]), new Rule(1, new FunApp("Warm",[]),[],[[new Terminal("warm")]]), new Rule(2, new FunApp("Cheese",[]),[],[[new Terminal("cheese")]]), new Rule(2, new FunApp("Fish",[]),[],[[new Terminal("fish")]]), new Rule(2, new FunApp("QKind",[new Arg(0), new Arg(1)]),[1, 2],[[new ArgProj(0, 0), new ArgProj(1, 0)]]), new Rule(2, new FunApp("Wine",[]),[],[[new Terminal("wine")]]), new Rule(3, new FunApp("Is",[new Arg(0), new Arg(1)]),[4, 1],[[new ArgProj(0, 0), new Terminal("is"), new ArgProj(1, 0)]]), new Rule(4, new FunApp("That",[new Arg(0)]),[2],[[new Terminal("that"), new ArgProj(0, 0)]]), new Rule(4, new FunApp("This",[new Arg(0)]),[2],[[new Terminal("this"), new ArgProj(0, 0)]])],{Float:[-3], Int:[-2], Item:[4], Kind:[2], Phrase:[3], Quality:[1], String:[-1], _Var:[-4]})), FoodIta: new GFConcrete({},{Boring: function(cs){return new Arr(new Str("noioso"));}, Cheese: function(cs){return new Arr(new Str("formaggio"));}, Delicious: function(cs){return new Arr(new Str("delizioso"));}, Expensive: function(cs){return new Arr(new Str("caro"));}, Fish: function(cs){return new Arr(new Str("pesce"));}, Fresh: function(cs){return new Arr(new Str("fresco"));}, Is: function(cs){return new Arr(new Seq(cs[0].sel(new Int(0)), new Str("è"), cs[1].sel(new Int(0))));}, Italian: function(cs){return new Arr(new Str("italiano"));}, QKind: function(cs){return new Arr(new Seq(cs[1].sel(new Int(0)), cs[0].sel(new Int(0))));}, That: function(cs){return new Arr(new Seq(new Str("quel"), cs[0].sel(new Int(0))));}, This: function(cs){return new Arr(new Seq(new Str("questo"), cs[0].sel(new Int(0))));}, Very: function(cs){return new Arr(new Seq(new Str("molto"), cs[0].sel(new Int(0))));}, Warm: function(cs){return new Arr(new Str("caldo"));}, Wine: function(cs){return new Arr(new Str("vino"));}, Item: function(cs){return new Arr(cs[0]);}, Kind: function(cs){return new Arr(cs[0]);}, Phrase: function(cs){return new Arr(cs[0]);}, Quality: function(cs){return new Arr(cs[0]);}, "Int": function(cs){return new Arr(cs[0]);}, "Float": function(cs){return new Arr(cs[0]);}, "String": function(cs){return new Arr(cs[0]);}}, new Parser("Phrase",[new Rule(1, new FunApp("Boring",[]),[],[[new Terminal("noioso")]]), new Rule(1, new FunApp("Delicious",[]),[],[[new Terminal("delizioso")]]), new Rule(1, new FunApp("Expensive",[]),[],[[new Terminal("caro")]]), new Rule(1, new FunApp("Fresh",[]),[],[[new Terminal("fresco")]]), new Rule(1, new FunApp("Italian",[]),[],[[new Terminal("italiano")]]), new Rule(1, new FunApp("Very",[new Arg(0)]),[1],[[new Terminal("molto"), new ArgProj(0, 0)]]), new Rule(1, new FunApp("Warm",[]),[],[[new Terminal("caldo")]]), new Rule(2, new FunApp("Cheese",[]),[],[[new Terminal("formaggio")]]), new Rule(2, new FunApp("Fish",[]),[],[[new Terminal("pesce")]]), new Rule(2, new FunApp("QKind",[new Arg(0), new Arg(1)]),[1, 2],[[new ArgProj(1, 0), new ArgProj(0, 0)]]), new Rule(2, new FunApp("Wine",[]),[],[[new Terminal("vino")]]), new Rule(3, new FunApp("Is",[new Arg(0), new Arg(1)]),[4, 1],[[new ArgProj(0, 0), new Terminal("è"), new ArgProj(1, 0)]]), new Rule(4, new FunApp("That",[new Arg(0)]),[2],[[new Terminal("quel"), new ArgProj(0, 0)]]), new Rule(4, new FunApp("This",[new Arg(0)]),[2],[[new Terminal("questo"), new ArgProj(0, 0)]])],{Float:[-3], Int:[-2], Item:[4], Kind:[2], Phrase:[3], Quality:[1], String:[-1], _Var:[-4]}))});
diff --git a/src/runtime/javascript/minus.png b/src/runtime/javascript/minus.png
new file mode 100644
index 000000000..84cc2a9ba
--- /dev/null
+++ b/src/runtime/javascript/minus.png
Binary files differ
diff --git a/src/runtime/javascript/plus.png b/src/runtime/javascript/plus.png
new file mode 100644
index 000000000..4d2e8ee83
--- /dev/null
+++ b/src/runtime/javascript/plus.png
Binary files differ
diff --git a/src/runtime/javascript/style.css b/src/runtime/javascript/style.css
new file mode 100644
index 000000000..962c3701f
--- /dev/null
+++ b/src/runtime/javascript/style.css
@@ -0,0 +1,241 @@
+body {
+ font-family:arial,helvetica,sans-serif;
+ font-size:12px;
+ background-color: white;
+}
+
+#wrapper {
+ width:740px;
+ height:520px;
+ margin:auto 50px;
+ border:1px solid gray;
+ padding:10px;
+
+}
+
+#absFrame {
+ width:250px;
+ height:250px;
+ padding:10px;
+ border:1px solid gray;
+ float:left;
+ white-space: nowrap;
+}
+
+#conFrame {
+ width:436px;
+ height:250px;
+ margin-left:10px;
+ padding:10px;
+ border:1px solid gray;
+ float:left;
+ white-space: normal;
+ overflow:auto;
+}
+
+#actFrame {
+ width:250px;
+ height:170px;
+ margin-top:10px;
+ padding:10px;
+ border:1px solid gray;
+ float:left;
+ overflow:auto;
+}
+
+#refFrame {
+ width:436px;
+ height:170px;
+ margin-left:10px;
+ margin-top:10px;
+ padding:10px;
+ border:1px solid gray;
+ float:left;
+ overflow:auto;
+}
+
+#messageFrame {
+ width:506px;
+ height:15px;
+ margin-top:10px;
+ margin-right:10px;
+ padding:10px;
+ border:1px solid gray;
+ float:left;
+ overflow:hidden;
+}
+
+#clipboardFrame {
+ width:180px;
+ height:15px;
+ margin-top:10px;
+ padding:10px;
+ border:1px solid gray;
+ float:left;
+ overflow:auto;
+}
+
+#tree {
+ left: -10px;
+ top: -10px;
+ width: 250px;
+ height: 250px;
+ margin: 0px;
+ padding: 10px;
+ overflow: auto;
+}
+
+ul {
+ position: relative;
+ list-style: none;
+ margin-left: 20px;
+ padding: 0px;
+}
+
+li {
+ position: relative;
+}
+
+img.tree-menu {
+ margin-right: 5px;
+}
+
+a.tree:link, a.tree:visited, a.tree:active {
+ color: black;
+ background-color: white;
+ text-decoration: none;
+ margin-right:10px;
+}
+
+a.tree:hover {
+ color: blue;
+ background-color: white;
+ text-decoration: underline;
+ margin-right:10px;
+}
+
+a.treeSelected:link, a.treeSelected:visited, a.treeSelected:active {
+ color: white;
+ background-color: #3366CC;
+ text-decoration: none;
+ margin-right:10px;
+}
+
+a.treeSelected:hover {
+ color: white;
+ background-color: #3366CC;
+ text-decoration: underline;
+ margin-right:10px;
+}
+
+a.treeGray:link, a.treeGray:visited, a.treeGray:active {
+ color: silver;
+ background-color: white;
+ text-decoration: none;
+ margin-right:10px;
+}
+
+a.treeGray:hover {
+ color: silver;
+ background-color: white;
+ text-decoration: none;
+ margin-right:10px;
+}
+
+table.action, table.refinement, table.wrapper, table.tree, table.language {
+ margin: 0px;
+ padding: 0px;
+ border-style: none;
+ border-collapse: collapse;
+ border-spacing: 0px;
+}
+
+tr.selected {
+ color: white;
+ background-color: #3366CC;
+}
+
+tr.unavailable, tr.closed {
+ color: silver;
+ background-color: white;
+}
+
+tr.unavailable:hover {
+ color: silver;
+ background-color: #3366CC;
+}
+
+tr.action, tr.refinement, tr.wrapper, tr.tree {
+ color: black;
+ background-color: white;
+}
+
+tr.action:hover, tr.refinement:hover, tr.wrapper:hover, tr.tree:hover {
+ color: white;
+ background-color: #3366CC;
+}
+
+td.action {
+ width: 220px;
+ margin: 0px;
+ padding: 0px;
+}
+
+td.refinement, td.wrapper, td.tree {
+ width: 515px;
+ margin: 0px;
+ padding: 0px;
+}
+
+td.hotKey {
+ width: 30px;
+ margin: 0px;
+ padding: 0px;
+ text-align: right;
+}
+
+td.language {
+ color: black;
+ background-color: white;
+ margin: 1px;
+ padding: 1px;
+}
+
+td.language:hover {
+ color: blue;
+ background-color: white;
+ text-decoration: underline;
+ margin: 1px;
+ padding: 1px;
+}
+
+td.selected {
+ color: white;
+ background-color: #3366CC;
+ margin: 1px;
+ padding: 1px;
+}
+
+td.selected:hover {
+ color: white;
+ background-color: #3366CC;
+ text-decoration: underline;
+ margin: 1px;
+ padding: 1px;
+}
+
+p {
+ margin-bottom: 40px;
+}
+
+span.normal {
+ color: black;
+ background-color: white;
+ text-decoration: none;
+}
+
+span.selected {
+ color: white;
+ background-color: #3366CC;
+ text-decoration: none;
+}
diff --git a/src/runtime/javascript/translator.css b/src/runtime/javascript/translator.css
new file mode 100644
index 000000000..f7f771927
--- /dev/null
+++ b/src/runtime/javascript/translator.css
@@ -0,0 +1,54 @@
+body {
+ color: black;
+ background-color: white;
+}
+
+dl {
+
+}
+
+dt {
+ margin: 0;
+ padding: 0;
+}
+
+dl dd {
+ margin: 0;
+ padding: 0;
+}
+
+dl.fromLang dt {
+ display: none;
+}
+
+dl.toLang {
+ border-width: 1px 0 0 0;
+ border-style: solid;
+ border-color: #c0c0c0;
+}
+
+dl.toLang dt {
+ color: #c0c0c0;
+ display: block;
+ float: left;
+ width: 5em;
+}
+
+
+dl.toLang dd {
+ border-width: 0 0 1px 0;
+ border-style: solid;
+ border-color: #c0c0c0;
+}
+
+
+ul {
+ margin: 0;
+ padding: 0;
+}
+
+li {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+} \ No newline at end of file
diff --git a/src/runtime/javascript/translator.html b/src/runtime/javascript/translator.html
new file mode 100644
index 000000000..b6fd37086
--- /dev/null
+++ b/src/runtime/javascript/translator.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <link rel="stylesheet" type="text/css" href="translator.css" />
+ <script type="text/javascript" src="gflib.js"></script>
+ <script type="text/javascript" src="grammar.js"></script>
+ <script type="text/javascript" src="translator.js"></script>
+ <script type="text/javascript">
+ /* CHANGE ME */
+ var grammar = Food;
+
+ function updateTranslation () {
+ var input = document.getElementById('inputText').value;
+ var fromLang = document.getElementById('fromLang').value;
+ var toLang = document.getElementById('toLang').value;
+ var output = document.getElementById('output');
+ var translation = grammar.translate(input, fromLang, toLang);
+ removeChildren(output);
+ output.appendChild(formatTranslation(translation));
+ }
+
+ function populateLangs () {
+ var f = document.getElementById('fromLang');
+ var t = document.getElementById('toLang');
+ for (var c in grammar.concretes) {
+ addOption(f, c, c);
+ addOption(t, c, c);
+ }
+ }
+ </script>
+ <title>Web-based GF Translator</title>
+ </head>
+ <body onload="populateLangs(Food, 'fromLang', 'toLang')">
+ <form id="translate">
+ <p>
+ <input type="text" name="inputText" id="inputText" value="this cheese is warm" size="50" />
+ </p>
+ <p>
+ From: <select name="fromLang" id="fromLang" onchange=""><option value="">Any language</option></select>
+ To: <select name="toLang" id="toLang"><option value="">All languages</option></select>
+ <input type="button" value="Translate" onclick="updateTranslation()" />
+ </p>
+ </form>
+ <div id="output"></div>
+ </body>
+</html>
diff --git a/src/runtime/javascript/translator.js b/src/runtime/javascript/translator.js
new file mode 100644
index 000000000..31da04290
--- /dev/null
+++ b/src/runtime/javascript/translator.js
@@ -0,0 +1,51 @@
+function formatTranslation (outputs) {
+ var dl1 = document.createElement("dl");
+ dl1.className = "fromLang";
+ for (var fromLang in outputs) {
+ var ul = document.createElement("ul");
+ addDefinition(dl1, document.createTextNode(fromLang), ul);
+ for (var i in outputs[fromLang]) {
+ var dl2 = document.createElement("dl");
+ dl2.className = "toLang";
+ for (var toLang in outputs[fromLang][i]) {
+ addDefinition(dl2, document.createTextNode(toLang), document.createTextNode(outputs[fromLang][i][toLang]));
+ }
+ addItem(ul, dl2);
+ }
+ }
+
+ return dl1;
+}
+
+/* DOM utilities for specific tags */
+
+function addDefinition (dl, t, d) {
+ var dt = document.createElement("dt");
+ dt.appendChild(t);
+ dl.appendChild(dt);
+ var dd = document.createElement("dd");
+ dd.appendChild(d);
+ dl.appendChild(dd);
+}
+
+function addItem (ul, i) {
+ var li = document.createElement("li");
+ li.appendChild(i);
+ ul.appendChild(li);
+}
+
+function addOption (select, value, content) {
+ var option = document.createElement("option");
+ option.value = value;
+ option.appendChild(document.createTextNode(content));
+ select.appendChild(option);
+}
+
+/* General DOM utilities */
+
+/* Removes all the children of a node */
+function removeChildren(node) {
+ while (node.hasChildNodes()) {
+ node.removeChild(node.firstChild);
+ }
+}
diff --git a/src/server/Makefile b/src/server/Makefile
deleted file mode 100644
index 7dcf29215..000000000
--- a/src/server/Makefile
+++ /dev/null
@@ -1,59 +0,0 @@
-GFCFLAGS = +RTS -K100M -RTS --cpu
-
-.PHONY: pgf.fcgi run gwt gf-gwt.jar
-
-pgf.fcgi:
- cabal install
- cp dist/build/pgf.fcgi/pgf.fcgi .
-
-gwt-translate:
- chmod a+x gwt/Translate-compile
- gwt/Translate-compile
-
-gwt-fridge:
- chmod a+x gwt/Fridge-compile
- gwt/Fridge-compile
-
-gwt-morpho:
- chmod a+x gwt/Morpho-compile
- gwt/Morpho-compile
-
-gf-gwt.jar:
- mkdir -p gwt/bin/se/chalmers/cs/gf/gwt/client
- javac -classpath "$(GWT_CLASSPATH):gwt/lib/gwt-dnd-2.5.6.jar" -sourcepath gwt/src gwt/src/se/chalmers/cs/gf/gwt/client/*.java
- jar -cf $@ -C gwt/src se
- cp $@ ../../lib/java
-
-food.pgf:
- gfc --make --name=food ../../examples/tutorial/resource-foods/Foods{Eng,Fin,Fre,Ger,Ita,Swe}.gf
-
-Demo%-parse.pgf: ../../next-lib/src/demo/Demo%.gf
- gfc $(GFCFLAGS) --make --erasing=on --name=Demo$*-parse $^
-
-Demo%-noparse.pgf: ../../next-lib/src/demo/Demo%.gf
- gfc $(GFCFLAGS) --make --parser=off --name=Demo$*-noparse $^
-
-Lang%-parse.pgf: ../../next-lib/alltenses/Lang%.gfo
- gfc $(GFCFLAGS) --make --erasing=on --name=Lang$*-parse $^
-
-Lang%-noparse.pgf: ../../next-lib/alltenses/Lang%.gfo
- gfc $(GFCFLAGS) --make --parser=off --name=Lang$*-noparse $^
-
-demo.pgf: DemoBul-noparse.pgf DemoCat-noparse.pgf DemoDan-noparse.pgf DemoEng-parse.pgf DemoFin-noparse.pgf DemoFre-noparse.pgf DemoGer-noparse.pgf DemoIta-noparse.pgf DemoNor-noparse.pgf DemoRus-noparse.pgf DemoSpa-noparse.pgf DemoSwe-parse.pgf
- gfc $(GFCFLAGS) --name=demo $^
-
-lang.pgf: LangBul-noparse.pgf LangCat-noparse.pgf LangDan-parse.pgf LangEng-parse.pgf LangFin-noparse.pgf LangFre-noparse.pgf LangGer-noparse.pgf LangIta-noparse.pgf LangNor-parse.pgf LangRus-noparse.pgf LangSpa-noparse.pgf LangSwe-parse.pgf
- gfc $(GFCFLAGS) --name=lang $^
-
-test.pgf: LangEng-parse.pgf LangGer-parse.pgf
- gfc $(GFCFLAGS) --name=test $^
-
-run: pgf.fcgi
- @echo '*********************************************'
- @echo 'See http://localhost:41296/'
- @echo '*********************************************'
- lighttpd -f lighttpd.conf -D
-
-clean:
- cabal clean
- -rm -f pgf.fcgi \ No newline at end of file
diff --git a/src/server/README b/src/server/README
deleted file mode 100644
index a22c596f4..000000000
--- a/src/server/README
+++ /dev/null
@@ -1,132 +0,0 @@
-== Requirements ==
-
-- cabal-install
- * See quick installation instructions at the bottom of
- http://hackage.haskell.org/trac/hackage/wiki/CabalInstall
-
-- GF installed as a Cabal package
- $ (cd ../.. && cabal install)
-
-- FastCGI development kit
- (MacPorts) $ sudo port install fcgi
- (Ubuntu) $ sudo apt-get install libfcgi-dev
-
-- Google Web Toolkit
- - Download from http://code.google.com/webtoolkit/
- - Unpack somewhere.
- - Set $GWT_CLASSPATH to point to the GWT JAR files. For example:
- $ export GWT_DIR="/Users/bringert/src/gwt-mac-1.5.3"
- $ export GWT_CLASSPATH="$GWT_DIR/gwt-user.jar:$GWT_DIR/gwt-dev-mac.jar"
-
-
-== Building ==
-
-- Build pgf.fcgi. This will use cabal to install the dependencies (cgi, fastcgi, json, utf8-string).
- $ make
-
-- Build small example grammar:
- $ make food.pgf
- $ cp food.pgf grammar.pgf
-
-
-== Running (lighttpd) ==
-
-- Install lighttpd
- (MacPorts) $ sudo port install lighttpd
- (Ubuntu) $ sudo apt-get install lighttpd
-
-- Run pgf.fcgi with lighttpd:
- $ make run
-
-
-== Testing ==
-
-- First test from the command-line, since debugging is harder from the AJAX UI:
- $ curl 'http://localhost:41296/pgf/grammar.pgf/translate?input=this+fish&cat=Item&from=FoodEng'
-
-- Non-GWT AJAX UI:
- See http://localhost:41296/simple-client.html
-
-- GWT translator:
- $ make gwt-translate
- Then see http://localhost:41296/translate/
-
-- GWT fridge poetry:
- $ make gwt-fridge
- Then see http://localhost:41296/fridge/
-
-- GWT morphology:
- $ make gwt-morpho
- Then see http://localhost:41296/morpho/
-
- The MorphoService.hs module has build-in paths to the grammar that will be loaded.
- This have to be fixed by hand
-
-== Running (Apache) ==
-
-Note: This is more complicated, and the instructions may not be up to date.
-
-- Make sure that your web server supports FastCGI. For Apache on OS X,
- do this:
-
-$ curl -O http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz
-$ tar -zxf mod_fastcgi-2.4.6.tar.gz
-$ cd mod_fastcgi-2.4.6/
-$ apxs -o mod_fastcgi.so -c *.c
-$ sudo apxs -i -a -n fastcgi mod_fastcgi.so
-
-- Make sure that your web server knows that gf.fcgi is a FastCGI
-program.
-
-- Make sure that you are allowed to run FastCGI programs in the
-directory that you use.
-
-- With large grammars, gf.fcgi may take long enough to start that the web server
-thinks that the program has died. With Apache, you can fix this by adding
-"FastCgiConfig -startDelay 30" to your httpd.conf.
-
-These sections from my Apache config fixes the above two
-(some of this may be fixed by the second apxs command above):
-
-(On OS X, this is in /etc/httpd/httpd.conf)
-
-LoadModule fastcgi_module libexec/httpd/mod_fastcgi.so
-AddModule mod_fastcgi.c
-
-<IfModule mod_fastcgi.c>
- FastCgiIpcDir /tmp/fcgi_ipc/
- AddHandler fastcgi-script .fcgi
- FastCgiConfig -startDelay 30
-</IfModule>
-
-
-(On OS X, this is in /etc/httpd/users/bringert.conf)
-
-<Directory "/Users/bringert/Sites/">
- Options Indexes MultiViews FollowSymlinks ExecCGI
- AddHandler cgi-script .cgi
- AllowOverride None
- Order allow,deny
- Allow from all
-</Directory>
-
-- If you have changed the web server config, you need to restart the web server
- (this is also useful to get a clean slate if you end up with dead or resource-hogging
- FastCGI processes):
-
-$ sudo apachectl restart
-
-- If Apache complains about a syntax error on the FastCgiIpcDir line, try deleting
- any existing /tmp/fcgi_ipc/ directory:
-
-$ sudo rm -rf /tmp/fcgi_ipc/
-
-- Copy or symlink this directory to your web directory.
-
-- First test from the command-line, since debugging is harder from the AJAX UI:
-
-$ curl 'http://localhost/~bringert/gf-server/gf.fcgi/translate?input=this+fish&cat=Item&from=FoodEng'
-
-- Check server logs (e.g. /var/log/httpd/error_log) if it doesn't work.
-
-- Go to SERVER_URL/simple-client.html in your web browser.