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:
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
22 const List* Execute(StackFrame& frame) const
24 // ignore all args and always return tubalcain!
25 return new(ma) List(ma, TextElement("tubalcain!"));
29 3. Create a mapping in NewRuntimeNode.cpp:
31 NODEFUNMATCH(tubalcain);
33 4. Build the project and enjoy your tubalcain!