суббота, 21 ноября 2009 г.

About syntax analizer in YAR Language

The YAR language syntax analizer supports for parsing methods:

-LL(1)
-CYK
-SLR,
-CLR(1)
-LARL(1)
-Simple precedence
-Operator precedence
-My extension for CLR method. I call it ECLR(1) method.

But YAR language now is being parsed by LARL(1) method.

Here is the semantic action sample

TTokenSequence.create(PNS_EXPR,[PTS_CONST_EXP_STRING],'',
function(LRAnalizer:TLRAnalizer):pointer
var value:TExprState;
begin
value.value:=LRAnalizer.StackValue[0].Lexeme;
value.ExprStateItem.TypeDesc:=StringTypeDesc;
PNS_EXPR.AttribitesList.Add(value);
result:=nil;
end
);

Комментариев нет: