/
ArgNames.sv
81 lines (64 loc) · 1.84 KB
/
ArgNames.sv
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
grammar silver:compiler:extension:doc:core;
synthesized attribute argNames::[String]
occurs on FunctionSignature, ProductionSignature, AspectProductionSignature,
AspectFunctionSignature, AspectRHS, AspectRHSElem, ProductionRHS, ProductionRHSElem;
aspect production functionSignature
top::FunctionSignature ::= cl::ConstraintList '=>' lhs::FunctionLHS '::=' rhs::ProductionRHS
{
top.argNames = rhs.argNames;
}
aspect production productionSignature
top::ProductionSignature ::= cl::ConstraintList '=>' lhs::ProductionLHS '::=' rhs::ProductionRHS
{
top.argNames = rhs.argNames;
}
aspect production productionRHSNil
top::ProductionRHS ::=
{
top.argNames = [];
}
aspect production productionRHSCons
top::ProductionRHS ::= h::ProductionRHSElem t::ProductionRHS
{
top.argNames = h.argNames ++ t.argNames;
}
aspect production productionRHSElem
top::ProductionRHSElem ::= id::Name '::' t::TypeExpr
{
top.argNames = [id.name];
}
aspect production productionRHSElemType
top::ProductionRHSElem ::= t::TypeExpr
{
top.argNames = []; -- Don't consider unnamed parameters against count
}
aspect production aspectProductionSignature
top::AspectProductionSignature ::= lhs::AspectProductionLHS '::=' rhs::AspectRHS
{
top.argNames = rhs.argNames;
}
aspect production aspectFunctionSignature
top::AspectFunctionSignature ::= lhs::AspectFunctionLHS '::=' rhs::AspectRHS
{
top.argNames = rhs.argNames;
}
aspect production aspectRHSElemNil
top::AspectRHS ::=
{
top.argNames = [];
}
aspect production aspectRHSElemCons
top::AspectRHS ::= h::AspectRHSElem t::AspectRHS
{
top.argNames = h.argNames ++ t.argNames;
}
aspect production aspectRHSElemNone
top::AspectRHSElem ::= '_'
{
top.argNames = []; -- Don't consider _ parameters against count
}
aspect production aspectRHSElemFull
top::AspectRHSElem ::= id::Name t::Type
{
top.argNames = [id.name];
}