Beispiel #1
0
        protected override MultiDeclareSyntaxElement ReturnDeclare(Selection <FixedList <LexicalElement, Optional <LexicalElement> >, LexicalElement> readonlyAnd_OptOfVar_OrVar, IdentifierSyntaxElement identifier, Optional <FixedList <LexicalElement, ExpressionSyntaxElement> > optOfEqualAndExpression, FixedList <LexicalElement, IdentifierSyntaxElement, Optional <FixedList <LexicalElement, ExpressionSyntaxElement> > >[] repeatOfCommaAndIdentifierAnd_OptOfEqualAndExpression)
        {
            LexicalElement head = new LexicalElement();

            VariableStorage.FieldProperty property = new VariableStorage.FieldProperty();
            if (readonlyAnd_OptOfVar_OrVar.Element1.HasValue)
            {
                head = readonlyAnd_OptOfVar_OrVar.Element1.Value.Element1;
                property.Readonly = true;
            }
            else
            {
                head = readonlyAnd_OptOfVar_OrVar.Element2.Value;
            }
            List <DeclareSyntaxElement> varList = new List <DeclareSyntaxElement>();

            if (optOfEqualAndExpression.HasValue)
            {
                DeclareSyntaxElement var1 = new DeclareSyntaxElement(identifier.LexAtStart, identifier.Identifier, property, optOfEqualAndExpression.Value.Element2);
                varList.Add(var1);
            }
            else
            {
                DeclareSyntaxElement var1 = new DeclareSyntaxElement(identifier.LexAtStart, identifier.Identifier, property);
                varList.Add(var1);
            }
            foreach (var declare in repeatOfCommaAndIdentifierAnd_OptOfEqualAndExpression)
            {
                DeclareSyntaxElement    var2;
                IdentifierSyntaxElement identifier2 = declare.Element2;
                if (declare.Element3.HasValue)
                {
                    ExpressionSyntaxElement expression2 = declare.Element3.Value.Element2;
                    var2 = new DeclareSyntaxElement(identifier2.LexAtStart, identifier2.Identifier, property, expression2);
                }
                else
                {
                    var2 = new DeclareSyntaxElement(identifier2.LexAtStart, identifier2.Identifier, property);
                }
                varList.Add(var2);
            }
            return(new MultiDeclareSyntaxElement(head, property, varList));
        }
Beispiel #2
0
 protected override ForeachSyntaxElement ReturnForeach(LexicalElement @foreach, LexicalElement openPar, Optional <LexicalElement> optOfVar, IdentifierSyntaxElement identifier, LexicalElement @in, ExpressionSyntaxElement expression, LexicalElement closePar, SyntaxElement statement)
 {
     return(new ForeachSyntaxElement(@foreach, identifier.Identifier, optOfVar.HasValue, expression, statement));
 }
Beispiel #3
0
 protected override ExpressionSyntaxElement ReturnProperty(IdentifierSyntaxElement identifier)
 {
     return(identifier);
 }
Beispiel #4
0
 protected override DotInvocationSyntaxElement ReturnDotInvocation(LexicalElement dot, IdentifierSyntaxElement identifier, ArgumentsSyntaxElement arguments)
 {
     return(new DotInvocationSyntaxElement(identifier.LexAtStart, arguments));
 }