preserve original author on edit
[couchdbimport.git] / CouchProjects / Fabric / Readme.txt
blob395c4716d61ab5f57d3fbf62097cde2bfe736a6c
2 Where to find commonly sought code:
4 The ANTLR grammar file is Grammar.g
6 List elements types are defined in Element.h.
8 The code for operators and functions is in header files:
9 MiscFunNodes.h
10 OperatorNodes.h
11 SpecialNodes.h
12 TextFunNodes.h
14 To create a new built-in function named "tubalcain()":
15 1. add "tubalcain" to the 'corefunctions' rule in grammar.g
16 2. Create a class Fun_tubalcain in MiscFunNodes.h like this:
18 class Fun_tubalcain : public RuntimeNode
20 public:
22         const List* Execute(StackFrame& frame) const
23         {
24                 // ignore all args and always return tubalcain!
25                 return new(ma) List(ma, TextElement("tubalcain!"));
26         }
29 3. Create a mapping in NewRuntimeNode.cpp:
31         NODEFUNMATCH(tubalcain);
32                 
33 4. Build the project and enjoy your tubalcain!