-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathHowTo.txt
65 lines (45 loc) · 2.28 KB
/
HowTo.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
How to add a new Generic Expansion Token
========================================
1. Edit CodeGenParser\Tokenizer.cs
- In the constructor, add the new token to the metaLookup collection
with TokenValidity.Anywhere
2. Edit CodeGenEngineShared\TokenExpanders\TokenExpanderGeneric.dbl
- Add a new expander method
- Add the new method to the genericTokenExpanders collection
3. Document the new token
How to add a new Generic Expression Token
========================================
1. Edit CodeGenParser\Tokenizer.cs
- In the constructor, add the new token to the expressions collection
with TokenValidity.Anywhere
2. Edit CodeGenEngineShared\ExpressionEvaluators\ExpressionEvaluatorGeneric.dbl
- Add a new evaluator method
- Add the new method to the genericExpressionEvaluators collection
3. Document the new token
How to add a new "Requires XXX token" file header token
=======================================================
1. Edit CodeGenParser\Tokenizer.cs
- In the constructor, add the new token to the metaLookup collection
2. Edit CodeGenParser\Parser.cs
- In the overload of the Parse method, add a new entry to the switch
statement to process the token the same way the other ones are
processed, specifying the appropriate TokenValidity.
How to add a new "Requires XXX expression" file header token
=======================================================
1. Edit CodeGenParser\Tokenizer.cs
- In the constructor, add the new token to the metaLookup collection
2. Edit CodeGenParser\Parser.cs
- In the overload of the Parse method, add a new entry to the switch
statement to process the token the same way the other ones are
processed, specifying the appropriate TokenValidity.
How to add a new Loop Type
==========================
1. Edit CodeGenEngine\Tokenizer.dbl
- In the constructor, add the new loop token to the metaLookup collection
2. Edit CodeGenEngine\TreeNodes.dbl
- Add a new class to represent the type of node.
3. Edit CodeGenEngine\Parser.dbl
- In the processLoop method, add a new entry to the USING statement.
4. Edit CodeGenEngine\LoopExpander.dbl
- In the constructor add a new item to loopProcessors to declare the
method to be used to process the loop, and implement the method.