|
|
@ -226,6 +226,37 @@ Not.match(stream, context, actions) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Sequence |
|
|
|
|
|
|
|
Sequence = Object.subtype(#Sequence); |
|
|
|
|
|
|
|
Sequence.match(stream, context, actions) { |
|
|
|
i = 0; |
|
|
|
match = 1; |
|
|
|
while (i < self.length() && match == 1) { |
|
|
|
match = self[i].match(stream, context, actions); |
|
|
|
} |
|
|
|
match; |
|
|
|
} |
|
|
|
|
|
|
|
// Alternation |
|
|
|
|
|
|
|
Alternation = Object.subtype(#Alternation); |
|
|
|
|
|
|
|
Alternation.match(stream, context, actions) { |
|
|
|
i = 0; |
|
|
|
match = 0; |
|
|
|
while(i < self.length() && match == 0){ |
|
|
|
initialActionCount = actions.length(); |
|
|
|
match = self[i].match(stream, context, actions); |
|
|
|
if (match == 0) { |
|
|
|
while (actions.length() > initialActionCount) { |
|
|
|
actions.pop(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Action |
|
|
|
|
|
|
|
Action = Object.subtype(#Action); |
|
|
|