示例#1
0
 private void AnalyzePropExpr(PropertyExpression expr)
 {
     if (!IsIdInitialized(expr.identifier))
     {
         createExNotInitializedExpr(expr.identifier);
     }
     if (!checkPropForId(expr.keyWord, InitializationVariables[expr.identifier]))
     {
         throw new Exception($"For {expr.identifier} property {expr.keyWord} isn't use");
     }
 }
        private PropertyExpression parsePropertyExpression(List <Token> left)
        {
            PropertyExpression expression = new PropertyExpression();

            if (left[0].Type == TokenType.Identifier)
            {
                expression.identifier = left[0].Value;
            }
            else
            {
                throw new Exception($"Line {left[0].Line}: In property value first parameter must be identifier");
            }
            if (left[2].Type == TokenType.KeyWord)
            {
                expression.keyWord = left[2].Value;
            }
            else
            {
                throw new Exception($"Line {left[2].Line}: In property value second parameter must be key word");
            }

            expression.Line = left[0].Line;
            return(expression);
        }