-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAst.n
54 lines (47 loc) · 1.07 KB
/
Ast.n
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
using System;
using Nemerle.Collections;
using Nemerle.Text;
using Nemerle.Utility;
using Nemerle.Peg;
namespace tinyacc
{
/// <summary>
/// Description of Ast.
/// </summary>
public enum OperationType
{
| Debit
| Credit
}
public variant Ast : Located
{
| Rate
{
From : string;
To : string;
Course : double;
}
| Account
{
Name : string;
Currency : string;
Balance : double;
}
| Operation
{
OperationType : OperationType;
Amount : double;
Currency : string;
AccountName : string;
Name : string;
}
| Bad
public GetMessage(msg : string) : string
{
//def pos = Location.StartPos;
//def len = Location.EndPos - Location.StartPos;
//$"$(Location.Source.FileName)$(Location.StartLineColumn.ToString()):[$pos:$len]: $msg"
$"$(Location.Source.FileName)$(Location.StartLineColumn.ToString()): $msg"
}
}
}