/// <summary> /// Initializes a new instance of the GlobalCode class. /// </summary> public GlobalCode(IList <Statement> /*!*/ statements, SourceUnit /*!*/ sourceUnit) { Debug.Assert(statements != null && sourceUnit != null); this.sourceUnit = sourceUnit; this.statements = statements.AsArray(); }
public FunctionDecl(SourceUnit /*!*/ sourceUnit, Text.Span span, Text.Span entireDeclarationPosition, int headingEndPosition, int declarationBodyPosition, bool isConditional, Scope scope, PhpMemberAttributes memberAttributes, string /*!*/ name, NamespaceDecl ns, bool aliasReturn, List <FormalParam> /*!*/ formalParams, List <FormalTypeParam> /*!*/ genericParams, IList <Statement> /*!*/ body, List <CustomAttribute> attributes) : base(span) { Debug.Assert(genericParams != null && name != null && formalParams != null && body != null); this.name = new Name(name); this.ns = ns; this.signature = new Signature(aliasReturn, formalParams); this.typeSignature = new TypeSignature(genericParams); if (attributes != null && attributes.Count != 0) { this.Attributes = new CustomAttributes(attributes); } this.body = body.AsArray(); this.entireDeclarationSpan = entireDeclarationPosition; this.headingEndPosition = headingEndPosition; this.declarationBodyPosition = declarationBodyPosition; this.IsConditional = isConditional; this.MemberAttributes = memberAttributes; this.Scope = scope; this.SourceUnit = sourceUnit; }
/// <summary> /// Initializes a new instance of the GlobalCode class. /// </summary> public GlobalCode(Text.Span span, IList <Statement> /*!*/ statements, SourceUnit /*!*/ sourceUnit) : base(span) { Debug.Assert(statements != null && sourceUnit != null); this.sourceUnit = sourceUnit; this.statements = statements.AsArray(); }
public EchoStmt(Text.Span span, IList <Expression> /*!*/ parameters) : base(span) { Debug.Assert(parameters != null); this.parameters = parameters.AsArray(); this.isHtmlCode = false; }
/// <summary> /// Initializes a new instance of the GlobalCode class. /// </summary> public GlobalCode(IList<Statement>/*!*/ statements, SourceUnit/*!*/ sourceUnit) { Debug.Assert(statements != null && sourceUnit != null); this.sourceUnit = sourceUnit; this.statements = statements.AsArray(); }
public EchoStmt(Text.Span span, IList<Expression>/*!*/ parameters) : base(span) { Debug.Assert(parameters != null); this.parameters = parameters.AsArray(); this.isHtmlCode = false; }
private ArrayEx(Text.Span span, IList <Item> items, Flags flags) : base(span) { Debug.Assert(flags != 0); _items = items.AsArray(); _flags = flags; }
public SwitchStmt(Text.Span span, Expression /*!*/ switchValue, IList <SwitchItem> /*!*/ switchItems) : base(span) { Debug.Assert(switchValue != null && switchItems != null); this.switchValue = switchValue; this.switchItems = switchItems.AsArray(); }
public UseStatement(Span span, IList <UseBase> uses, AliasKind kind) : base(span) { Debug.Assert(uses != null); _kind = kind; _uses = uses.AsArray(); }
public MultipleTypeRef(Span span, IList <TypeRef> /*!*/ multipleTypes) : base(span) { Debug.Assert(multipleTypes != null); Debug.Assert(multipleTypes.All(x => x != null)); _types = multipleTypes.AsArray(); }
public SwitchStmt(Text.Span span, Expression/*!*/ switchValue, IList<SwitchItem>/*!*/ switchItems) : base(span) { Debug.Assert(switchValue != null && switchItems != null); this.switchValue = switchValue; this.switchItems = switchItems.AsArray(); }
public TryStmt(Text.Span p, IList <Statement> /*!*/ statements, List <CatchItem> catches, FinallyItem finallyItem) : base(p) { Debug.Assert(statements != null); this.statements = statements.AsArray(); this.catches = catches.AsArray(); this.finallyItem = finallyItem; }
public TryStmt(Text.Span p, BlockStmt /*!*/ body, IList <CatchItem> catches, FinallyItem finallyItem) : base(p) { Debug.Assert(body != null); this.body = body; this.catches = catches.AsArray(); this.finallyItem = finallyItem; }
public TryStmt(Text.Span p, IList<Statement>/*!*/ statements, List<CatchItem> catches, FinallyItem finallyItem) : base(p) { Debug.Assert(statements != null); this.statements = statements.AsArray(); this.catches = catches.AsArray(); this.finallyItem = finallyItem; }
public GroupUse(Span span, QualifiedNameRef prefix, IList <SimpleUse> uses) : base(span) { Debug.Assert(span.IsValid); Debug.Assert(uses != null); _prefix = prefix; _uses = uses.AsArray(); }
public CatchItem(Text.Span p, DirectTypeRef tref, DirectVarUse /*!*/ variable, IList <Statement> /*!*/ statements) : base(p) { Debug.Assert(variable != null && statements != null); this.tref = tref; this.variable = variable; this.statements = statements.AsArray(); }
public CatchItem(Text.Span p, GenericQualifiedName className, DirectVarUse /*!*/ variable, IList <Statement> /*!*/ statements) : base(p) { Debug.Assert(variable != null && statements != null); this.className = className; this.variable = variable; this.statements = statements.AsArray(); }
public IEnumerable <TypeDeclarationSyntax> GetTypes(SyntaxNode namespaceNode) { var node = namespaceNode as NamespaceDeclarationSyntax; if (node != null) { Visit(node); } return(_types.AsArray()); }
public TraitsUse(Text.Span span, IList <TypeRef> /*!*/ traitsList, TraitAdaptationBlock traitAdaptationBlock) : base(span, PhpMemberAttributes.Public) { if (traitsList == null) { throw new ArgumentNullException("traitsList"); } Debug.Assert(traitsList.All(t => t is INamedTypeRef)); this.traitsList = traitsList.AsArray(); this.traitAdaptationBlock = traitAdaptationBlock; }
public IEnumerable <NamespaceDeclarationSyntax> GetNamespaces(SyntaxNode commonNode) { var node = commonNode as SyntaxNode; if (node != null) { Visit(node); } return(_namespaces.AsArray()); }
public ListEx(Text.Span p, IList <Item> /*!*/ lvalues) : base(p) { Debug.Assert(lvalues != null); //Debug.Assert(lvalues.All(item => item is ValueItem && ( // ((ValueItem)item).ValueExpr == null || // ((ValueItem)item).ValueExpr is VarLikeConstructUse || // ((ValueItem)item).ValueExpr is ListEx))); _items = lvalues.AsArray(); }
public ForStmt(Text.Span p, IList <Expression> /*!*/ initExList, IList <Expression> /*!*/ condExList, IList <Expression> /*!*/ actionExList, Text.Span conditionSpan, Statement /*!*/ body) : base(p) { Debug.Assert(initExList != null && condExList != null && actionExList != null && body != null); this.initExList = initExList.AsArray(); this.condExList = condExList.AsArray(); this.actionExList = actionExList.AsArray(); this.body = body; this._conditionSpan = conditionSpan; }
/// <summary> /// Create new method declaration. /// </summary> /// <param name="span">Entire span.</param> /// <param name="name">Method name.</param> /// <param name="aliasReturn"><c>true</c> if method returns alias, <c>false</c> otherwise.</param> /// <param name="formalParams">Parameters.</param> /// <param name="paramsSpan">Span of the parameters including parentheses.</param> /// <param name="genericParams">Generic parameters.</param> /// <param name="body">Method content.</param> /// <param name="modifiers">Method modifiers, visibility etc.</param> /// <param name="baseCtorParams">Parameters for the base class constructor.</param> /// <param name="returnType">Return type hint, optional.</param> public MethodDecl(Text.Span span, NameRef name, bool aliasReturn, IList <FormalParam> /*!*/ formalParams, Text.Span paramsSpan, IList <FormalTypeParam> /*!*/ genericParams, BlockStmt body, PhpMemberAttributes modifiers, IList <ActualParam> baseCtorParams, TypeRef returnType) : base(span, modifiers) { Debug.Assert(genericParams != null && formalParams != null); this.name = name; this.signature = new Signature(aliasReturn, formalParams, paramsSpan); this.typeSignature = new TypeSignature(genericParams); this.body = body; this.baseCtorParams = baseCtorParams.AsArray(); this.returnType = returnType; }
public MethodDecl(Text.Span span, Text.Span entireDeclarationPosition, int headingEndPosition, int declarationBodyPosition, string name, bool aliasReturn, IList <FormalParam> /*!*/ formalParams, IList <FormalTypeParam> /*!*/ genericParams, IList <Statement> body, PhpMemberAttributes modifiers, IList <ActualParam> baseCtorParams, List <CustomAttribute> attributes) : base(span, attributes) { Debug.Assert(genericParams != null && formalParams != null); this.modifiers = modifiers; this.name = new Name(name); this.signature = new Signature(aliasReturn, formalParams); this.typeSignature = new TypeSignature(genericParams); this.body = (body != null) ? body.AsArray() : null; this.baseCtorParams = (baseCtorParams != null) ? baseCtorParams.AsArray() : null; this.entireDeclarationSpan = entireDeclarationPosition; this.headingEndPosition = headingEndPosition; this.declarationBodyPosition = declarationBodyPosition; }
public SyntaxDeclarations GetDeclarations(IEnumerable <SyntaxTree> trees) { var syntaxTrees = trees.AsArray(); foreach (var root in syntaxTrees.Select(syntaxTree => syntaxTree.GetRoot())) { Visit(root); CheckStatementSyntax(root); } return(new SyntaxDeclarations { MemberDeclarations = _members.AsArray(), NamespaceDeclarations = _namespaces.AsArray(), Statements = _statements.AsArray(), TypeDeclarations = _types.AsArray() }); }
public TypeDecl( Text.Span span, Text.Span headingSpan, bool isConditional, PhpMemberAttributes memberAttributes, bool isPartial, IList <FormalTypeParam> /*!*/ genericParams, INamedTypeRef baseClass, IList <INamedTypeRef> /*!*/ implementsList, IList <TypeMemberDecl> /*!*/ elements, Text.Span bodySpan) : base(span) { Debug.Assert(genericParams != null && implementsList != null && elements != null); Debug.Assert((memberAttributes & PhpMemberAttributes.Trait) == 0 || (memberAttributes & PhpMemberAttributes.Interface) == 0, "Interface cannot be a trait"); this.typeSignature = new TypeSignature(genericParams); this.baseClass = baseClass; this.MemberAttributes = memberAttributes; this.IsConditional = isConditional; this.ImplementsList = implementsList.AsArray(); this.members = elements.AsArray(); this.headingSpan = headingSpan; this.bodySpan = bodySpan; this.partialKeyword = isPartial; }
public LambdaFunctionExpr(SourceUnit /*!*/ sourceUnit, Text.Span span, Text.Span entireDeclarationPosition, int headingEndPosition, int declarationBodyPosition, Scope scope, NamespaceDecl ns, bool aliasReturn, List <FormalParam> /*!*/ formalParams, List <FormalParam> useParams, IList <Statement> /*!*/ body) : base(span) { Debug.Assert(formalParams != null && body != null); Debug.Assert(sourceUnit != null); this.sourceUnit = sourceUnit; this.ns = ns; this.signature = new Signature(aliasReturn, formalParams); this.useParams = useParams; //this.typeSignature = new TypeSignature(genericParams); //this.attributes = new CustomAttributes(attributes); this.body = body.AsArray(); this.entireDeclarationSpan = entireDeclarationPosition; this.headingEndPosition = headingEndPosition; this.declarationBodyPosition = declarationBodyPosition; }
public Signature(bool aliasReturn, IList <FormalParam> /*!*/ formalParams) { this.aliasReturn = aliasReturn; this.formalParams = formalParams.AsArray(); }
/// <summary> /// Initialize the ConcatEx AST node and optimize the subtree if possible. Look for child expressions and chain possible concatenations. This prevents StackOverflowException in case of huge concatenation expressions. /// </summary> /// <param name="span"></param> /// <param name="expressions">List of expressions to concatenate.</param> /// <remarks>This method tries to propagate child concatenations and chain them.</remarks> public ConcatEx(Text.Span span, IList<Expression>/*!*/ expressions) : base(span) { Debug.Assert(expressions != null); this.expressions = expressions.AsArray(); }
public ArrayEx(Text.Span span, IList<Item>/*!*/items) : base(span) { Debug.Assert(items != null); this.items = items.AsArray(); }
protected SwitchItem(Text.Span span, IList<Statement>/*!*/ statements) : base(span) { Debug.Assert(statements != null); this.statements = statements.AsArray(); }
/// <summary> /// Initialize new instance of <see cref="CallSignature"/>. /// </summary> /// <param name="parameters">List of parameters.</param> /// <param name="genericParams">List of type parameters for generics.</param> public CallSignature(IList <ActualParam> parameters, IList <TypeRef> genericParams) { this.parameters = parameters.AsArray(); this.GenericParams = genericParams.AsArray(); }
public MethodDecl(Text.Span span, Text.Span entireDeclarationPosition, int headingEndPosition, int declarationBodyPosition, string name, bool aliasReturn, IList<FormalParam>/*!*/ formalParams, IList<FormalTypeParam>/*!*/ genericParams, IList<Statement> body, PhpMemberAttributes modifiers, IList<ActualParam> baseCtorParams, List<CustomAttribute> attributes) : base(span, attributes) { Debug.Assert(genericParams != null && formalParams != null); this.modifiers = modifiers; this.name = new Name(name); this.signature = new Signature(aliasReturn, formalParams); this.typeSignature = new TypeSignature(genericParams); this.body = (body != null) ? body.AsArray() : null; this.baseCtorParams = (baseCtorParams != null) ? baseCtorParams.AsArray() : null; this.entireDeclarationSpan = entireDeclarationPosition; this.headingEndPosition = headingEndPosition; this.declarationBodyPosition = declarationBodyPosition; }
public TraitAdaptationBlock(Text.Span span, IList <TraitsUse.TraitAdaptation> /*!*/ body) : base(span) { Debug.Assert(body != null); _adaptations = body.AsArray(); }
public TypeSignature(IList <FormalTypeParam> /*!!*/ typeParams) { Debug.Assert(typeParams != null); this.typeParams = typeParams.AsArray(); }
public BlockStmt(Text.Span span, IList <Statement> /*!*/ body) : base(span) { Debug.Assert(body != null); _statements = body.AsArray(); }
public FunctionDecl(SourceUnit/*!*/ sourceUnit, Text.Span span, Text.Span entireDeclarationPosition, int headingEndPosition, int declarationBodyPosition, bool isConditional, Scope scope, PhpMemberAttributes memberAttributes, string/*!*/ name, NamespaceDecl ns, bool aliasReturn, List<FormalParam>/*!*/ formalParams, List<FormalTypeParam>/*!*/ genericParams, IList<Statement>/*!*/ body, List<CustomAttribute> attributes) : base(span) { Debug.Assert(genericParams != null && name != null && formalParams != null && body != null); this.name = new Name(name); this.ns = ns; this.signature = new Signature(aliasReturn, formalParams); this.typeSignature = new TypeSignature(genericParams); if (attributes != null && attributes.Count != 0) this.Attributes = new CustomAttributes(attributes); this.body = body.AsArray(); this.entireDeclarationPosition = entireDeclarationPosition; this.headingEndPosition = headingEndPosition; this.declarationBodyPosition = declarationBodyPosition; this.IsConditional = isConditional; this.MemberAttributes = memberAttributes; this.Scope = scope; this.SourceUnit = sourceUnit; }
public Signature(bool aliasReturn, IList<FormalParam>/*!*/ formalParams) { this.aliasReturn = aliasReturn; this.formalParams = formalParams.AsArray(); }
public TypeSignature(IList<FormalTypeParam>/*!!*/ typeParams) { Debug.Assert(typeParams != null); this.typeParams = typeParams.AsArray(); }
/// <summary> /// Initialize new instance of <see cref="CallSignature"/>. /// </summary> /// <param name="parameters">List of parameters.</param> /// <param name="genericParams">List of type parameters for generics.</param> public CallSignature(IList<ActualParam> parameters, IList<TypeRef> genericParams) { this.parameters = parameters.AsArray(); this.GenericParams = genericParams.AsArray(); }
public CatchItem(Text.Span p, DirectTypeRef tref, DirectVarUse/*!*/ variable, IList<Statement>/*!*/ statements) : base(p) { Debug.Assert(variable != null && statements != null); this.tref = tref; this.variable = variable; this.statements = statements.AsArray(); }
public BlockStmt(Text.Span span, IList<Statement>/*!*/body) : base(span) { Debug.Assert(body != null); _statements = body.AsArray(); }
public TraitAdaptationPrecedence(Text.Span span, Tuple <TypeRef, NameRef> traitMemberName, IList <TypeRef> /*!*/ ignoredTypes) : base(span, traitMemberName) { this.IgnoredTypes = ignoredTypes.AsArray(); }
public LambdaFunctionExpr(SourceUnit/*!*/ sourceUnit, Text.Span span, Text.Span entireDeclarationPosition, int headingEndPosition, int declarationBodyPosition, Scope scope, NamespaceDecl ns, bool aliasReturn, List<FormalParam>/*!*/ formalParams, List<FormalParam> useParams, IList<Statement>/*!*/ body) : base(span) { Debug.Assert(formalParams != null && body != null); Debug.Assert(sourceUnit != null); this.sourceUnit = sourceUnit; this.ns = ns; this.signature = new Signature(aliasReturn, formalParams); this.useParams = useParams; //this.typeSignature = new TypeSignature(genericParams); //this.attributes = new CustomAttributes(attributes); this.body = body.AsArray(); this.entireDeclarationPosition = entireDeclarationPosition; this.headingEndPosition = headingEndPosition; this.declarationBodyPosition = declarationBodyPosition; }
public FinallyItem(Text.Span span, IList<Statement>/*!*/statements) : base(span) { this.statements = statements.AsArray(); }
/// <summary> /// Initialize the ConcatEx AST node and optimize the subtree if possible. Look for child expressions and chain possible concatenations. This prevents StackOverflowException in case of huge concatenation expressions. /// </summary> /// <param name="span"></param> /// <param name="expressions">List of expressions to concatenate.</param> /// <remarks>This method tries to propagate child concatenations and chain them.</remarks> public ConcatEx(Text.Span span, IList <Expression> /*!*/ expressions) : base(span) { Debug.Assert(expressions != null); this.expressions = expressions.AsArray(); }