public StiParserMethodInfo(StiFunctionType name, int number, Type[] arguments, Type returnType)
 {
     this.Name       = name;
     this.Number     = number;
     this.Arguments  = arguments;
     this.ReturnType = returnType;
 }
 public StiParserMethodInfo(StiFunctionType name, int number, Type[] arguments)
 {
     this.Name       = name;
     this.Number     = number;
     this.Arguments  = arguments;
     this.ReturnType = typeof(string);
 }
Esempio n. 3
0
 //----------------------------------------
 // Получение значения числа или переменной
 //----------------------------------------
 private void atom()
 {
     if (currentToken.Type == StiTokenType.Variable)
     {
         asmList.Add(new StiAsmCommand(StiAsmCommandType.PushVariable, currentToken.Value));
         get_token();
         return;
     }
     else if (currentToken.Type == StiTokenType.SystemVariable)
     {
         asmList.Add(new StiAsmCommand(StiAsmCommandType.PushSystemVariable, SystemVariablesList[currentToken.Value]));
         get_token();
         return;
     }
     else if (currentToken.Type == StiTokenType.Function)
     {
         StiToken        function     = currentToken;
         StiFunctionType functionType = (StiFunctionType)FunctionsList[function.Value];
         asmList.Add(new StiAsmCommand(StiAsmCommandType.PushFunction, functionType, get_args_count(functionType)));
         get_token();
         return;
     }
     else if (currentToken.Type == StiTokenType.Method)
     {
         StiToken      method     = currentToken;
         StiMethodType methodType = (StiMethodType)MethodsList[method.Value];
         asmList.Add(new StiAsmCommand(StiAsmCommandType.PushMethod, methodType, get_args_count(methodType) + 1));
         get_token();
         return;
     }
     else if (currentToken.Type == StiTokenType.Property)
     {
         StiToken function = currentToken;
         asmList.Add(new StiAsmCommand(StiAsmCommandType.PushProperty, PropertiesList[function.Value]));
         get_token();
         return;
     }
     else if (currentToken.Type == StiTokenType.DataSourceField)
     {
         asmList.Add(new StiAsmCommand(StiAsmCommandType.PushDataSourceField, currentToken.Value));
         get_token();
         return;
     }
     else if (currentToken.Type == StiTokenType.BusinessObjectField)
     {
         asmList.Add(new StiAsmCommand(StiAsmCommandType.PushBusinessObjectField, currentToken.Value));
         get_token();
         return;
     }
     else if (currentToken.Type == StiTokenType.Component)
     {
         asmList.Add(new StiAsmCommand(StiAsmCommandType.PushComponent, ComponentsList[currentToken.Value]));
         get_token();
         return;
     }
     else if (currentToken.Type == StiTokenType.Number)
     {
         asmList.Add(new StiAsmCommand(StiAsmCommandType.PushValue, currentToken.ValueObject));
         get_token();
         return;
     }
     else if (currentToken.Type == StiTokenType.String)
     {
         asmList.Add(new StiAsmCommand(StiAsmCommandType.PushValue, currentToken.ValueObject));
         get_token();
         return;
     }
     else
     {
         if (currentToken.Type == StiTokenType.Empty)
         {
             ThrowError(ParserErrorCode.UnexpectedEndOfExpression); //неожиданный конец выражения
         }
         ThrowError(ParserErrorCode.SyntaxError, currentToken);     //cинтаксическая ошибка
     }
 }