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
|
SimpleBlockStart -> @"{{";
SimpleBlockEnd -> @"}}";
EOF -> @"^$";
[Skip] WHITESPACE -> @"\s+";
IDENTIFIANT -> @"[a-zA-Z_][a-zA-Z0-9_]*";
AREA -> @"[a-zA-Z_][a-zA-Z0-9_]*";
ALL -> @"[a-zA-Z0-9_ <>/\\{}]*";
FCT_AREA -> @" *area *";
Start -> Instructions EOF {return $Instructions ; };
Instructions -> ALL(Block)*
{
string ret = "";
if($ALL[0] != null)
ret += $ALL[0];
int i = 0;
while ($Block[i] != null) {
ret += $Block[i];
i++;
}
if($ALL[1] != null)
ret += $ALL[1];
return ret;
};
Block -> SimpleBlock
{
if ($SimpleBlock != null)
return $SimpleBlock;
return $ComplexBlock;
};
SimpleBlock -> SimpleBlockStart SimpleBlockArea SimpleBlockEnd (ALL)?
{
string ret = "";
if($SimpleBlockArea != null)
ret += $SimpleBlockArea;
else
ret += $SimpleBlockItem;
return ret + $ALL;
};
SimpleBlockArea -> FCT_AREA AREA
{
//must be override in ParseNode.Custom
return "area: " + $AREA + "\n" ;
}; |
Partager