Beispiel #1
0
        public static LocalDefinition DefineLocal(Syntax.IdentifierSyntax pNode, SmallType pType)
        {
            var ld = LocalDefinition.Create(pNode, pNode.Value, pType);

            _locals[_locals.Count - 1].Add(pNode.Value, ld);
            return(ld);
        }
Beispiel #2
0
 public DeclarationStatementSyntax(IdentifierSyntax pLeft, ExpressionSyntax pRight)
 {
     Identifier = pLeft;
     Value      = pRight;
     if (Identifier != null)
     {
         Identifier.Parent = this;
     }
     if (Value != null)
     {
         Value.Parent = this;
     }
 }
Beispiel #3
0
        internal static ExpressionSyntax AssignmentExpression(TokenType pToken, IdentifierSyntax pName, ExpressionSyntax pValue)
        {
            switch (pToken)
            {
            case TokenType.PlusEquals:
                return(new AddAssignmentExpressionSyntax(0, pName, pValue));

            case TokenType.PeriodPeriodEquals:
                return(new CatAssignmentExpressionSyntax(0, pName, pValue));

            case TokenType.SlashEquals:
                return(new DivAssignmentExpressionSyntax(0, pName, pValue));

            case TokenType.StarEquals:
                return(new MulAssignmentExpressionSyntax(0, pName, pValue));

            case TokenType.MinusEquals:
                return(new SubAssignmentExpressionSyntax(0, pName, pValue));

            default:
                throw new Exception("Unknown assignment " + pToken.ToString());
            }
        }
Beispiel #4
0
 public virtual void Visit(IdentifierSyntax pNode)
 {
 }
Beispiel #5
0
 public static LocalDefinition DefineField(Syntax.IdentifierSyntax pNode, SmallType pType, SmallType pStructType)
 {
     return(LocalDefinition.CreateAsField(pNode, pNode.Value, pType, pStructType));
 }
 public LengthQueryExpressionSyntax(IdentifierSyntax pValue) : base("len")
 {
     Array = pValue;
 }
Beispiel #7
0
 public virtual SyntaxNode Visit(IdentifierSyntax pNode)
 {
     return(pNode);
 }
Beispiel #8
0
 public static ConstSyntax Const(IdentifierSyntax pIdentifier, IdentifierSyntax pValue)
 {
     return(new ConstSyntax(pIdentifier, pValue));
 }
Beispiel #9
0
 public static LengthQueryExpressionSyntax LengthQueryExpression(IdentifierSyntax pValue)
 {
     return(new LengthQueryExpressionSyntax(pValue));
 }
Beispiel #10
0
 public static MemberAccessSyntax MemberAccess(IdentifierSyntax pName, IdentifierSyntax pValue)
 {
     return(new MemberAccessSyntax(pName, pValue));
 }
Beispiel #11
0
 public static AssignmentStatementSyntax AssignmentStatement(IdentifierSyntax pLeft, ExpressionSyntax pRight)
 {
     return(new AssignmentStatementSyntax(pLeft, pRight));
 }
Beispiel #12
0
 public static DeclarationStatementSyntax DeclarationStatement(IdentifierSyntax pLeft, ExpressionSyntax pRight)
 {
     return(new DeclarationStatementSyntax(pLeft, pRight));
 }
Beispiel #13
0
 public static ArrayAccessExpressionSyntax ArrayAccessExpression(IdentifierSyntax pValue, ExpressionSyntax pIndex)
 {
     return(new ArrayAccessExpressionSyntax(pValue, pIndex));
 }
Beispiel #14
0
 public static SubAssignmentExpressionSyntax SubAssignmentExpression(IdentifierSyntax pLeft, ExpressionSyntax pRight)
 {
     return(new SubAssignmentExpressionSyntax(0, pLeft, pRight));
 }