/// <summary> /// Initializes a new instance of the <see cref="MethodDeclaration"/> class. /// </summary> /// <param name="name">The name of the method</param> /// <param name="isAsync">Defines whether the method can be call asynchronously</param> /// <param name="isExtern">Defines whether the method can be call outside of the interpreter or Assembly.</param> public MethodDeclaration(string name, bool isAsync, bool isExtern) : this() { Name = new MemberIdentifier(name); IsAsync = isAsync; IsExtern = isExtern; }
/// <summary> /// Initliaze a new instance of the <see cref="ClassReferenceExpression"/> class. /// </summary> /// <param name="namespace">The full namespace path that contains the class</param> /// <param name="className">The name of the class</param> public ClassReferenceExpression(string @namespace, string className) { if (!IsValidNamespace(@namespace)) { throw new ArgumentException(L.BaZic.AbstractSyntaxTree.InvalidNamespace, nameof(@namespace)); } Namespace = @namespace; ClassName = new MemberIdentifier(className); }
/// <summary> /// Initializes a new instance of the <see cref="LabelDeclaration"/> class. /// </summary> /// <param name="name">The label name</param> public LabelDeclaration(string name) { Name = new MemberIdentifier(name); }
/// <summary> /// Initializes a new instance of then <see cref="LabelConditionStatement"/> class. /// </summary> /// <param name="condition">The condition</param> /// <param name="labelName">The name of the label to go when the condition is not validated.</param> public LabelConditionStatement(Expression condition, string labelName) { Condition = new NotOperatorExpression(condition); LabelName = new MemberIdentifier(labelName); }
/// <summary> /// Initializes a new instance of the <see cref="InvokeMethodExpression"/> class. /// </summary> /// <param name="methodName">The method name to call</param> /// <param name="await">Defines whether a call to a asynchronous method should be done synchronously or not</param> public InvokeMethodExpression(string methodName, bool await) : this() { MethodName = new MemberIdentifier(methodName); Await = await; }
/// <summary> /// Initializes a new instance of the <see cref="PropertyReferenceExpression"/> class. /// </summary> /// <param name="targetObject">The class reference or variable that contains the property</param> /// <param name="name">The name of the variable we make reference</param> public PropertyReferenceExpression(ReferenceExpression targetObject, string name) { TargetObject = targetObject; PropertyName = new MemberIdentifier(name); }
/// <summary> /// Initializes a new instance of the <see cref="ParameterDeclaration"/> class. /// </summary> /// <param name="name">The name of the argument</param> /// <param name="isArray">Define whether the argument is of type <see cref="object"/> or <see cref="Collection{T}"/> of <see cref="object"/></param> public ParameterDeclaration(string name, bool isArray = false) { Name = new MemberIdentifier(name); IsArray = isArray; }
/// <summary> /// Initializes a new instance of the <see cref="VariableReferenceExpression"/> class. /// </summary> /// <param name="name">The name of the variable we make reference</param> public VariableReferenceExpression(string name) { Name = new MemberIdentifier(name); }
/// <summary> /// Initializes a new instance of the <see cref="GoToLabelStatement"/> class. /// </summary> /// <param name="name">The label name</param> public GoToLabelStatement(string name) { Name = new MemberIdentifier(name); }