diff options
| author | hallgren <hallgren@chalmers.se> | 2011-11-02 16:54:22 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2011-11-02 16:54:22 +0000 |
| commit | 312e602dfe69fc6d391d58d715fccad6c1ed1023 (patch) | |
| tree | 9fab05948c36ce7a1804405eb8c273da2a6b897c /src/example-based | |
| parent | 5856098f2f71dc443cf6412443d6b3efbcb8efb8 (diff) | |
gfse: supply information about what's defined in the exampe language to the server functions for example-based grammar writing
Diffstat (limited to 'src/example-based')
| -rw-r--r-- | src/example-based/ExampleDemo.hs | 4 | ||||
| -rw-r--r-- | src/example-based/ExampleService.hs | 10 | ||||
| -rw-r--r-- | src/example-based/todo.txt | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/src/example-based/ExampleDemo.hs b/src/example-based/ExampleDemo.hs index 2f344f0a3..1d5fabcaf 100644 --- a/src/example-based/ExampleDemo.hs +++ b/src/example-based/ExampleDemo.hs @@ -42,8 +42,8 @@ data Environ = Env {getTypeMap :: TypeMap, -- mapping between a } -getNext :: Environ -> ([MyFunc],[MyFunc]) -getNext env = +getNext :: Environ -> Environ -> ([MyFunc],[MyFunc]) +getNext env example_env = let sgs = getSigs env allfuncs = getAll env names = Set.fromList $ map getName $ concat $ Map.elems sgs diff --git a/src/example-based/ExampleService.hs b/src/example-based/ExampleService.hs index 0065fd4dd..185e4fd94 100644 --- a/src/example-based/ExampleService.hs +++ b/src/example-based/ExampleService.hs @@ -22,12 +22,16 @@ cgiMain' root cwd cache = do command <- getInp "command" environ <- parseEnviron =<< getInp "state" case command of - "possibilities" -> outputJSONP (E.getNext environ) - "provide_example" -> doProvideExample root cwd cache environ + "possibilities" -> doPossibilities environ + "provide_example" -> doProvideExample root cwd cache environ "abstract_example" -> doAbstractExample cwd cache environ - "test_function" -> doTestFunction cwd cache environ + "test_function" -> doTestFunction cwd cache environ _ -> throwCGIError 400 ("Unknown command: "++command) [] +doPossibilities environ = + do example_environ <- parseEnviron =<< getInp "example_state" + outputJSONP (E.getNext environ example_environ) + doProvideExample root cwd cache environ = do Just lang <- readInput "lang" fun <- getCId "fun" diff --git a/src/example-based/todo.txt b/src/example-based/todo.txt index ebecba435..196dbc097 100644 --- a/src/example-based/todo.txt +++ b/src/example-based/todo.txt @@ -1,7 +1,7 @@ Editor improvements for example-based grammar writing: + Remove the same language from the example language menu -- Send the other language environment to getNext ++ Send the other language environment to getNext - Compile a new .pgf automatically when needed - Update buttons automatically when functions are added or removed - Switch over to using AbsParadigmsEng.pgf instead of the old exprToAPI function |
