/// <summary> /// Finds the matching nodes of a <see cref="IManifestStringExpression"/>. /// </summary> /// <param name="node">The agent expression to check.</param> /// <param name="errorList">The list of errors found.</param> /// <param name="resolvedResult">The expression result types upon return.</param> /// <param name="resolvedException">Exceptions the expression can throw upon return.</param> /// <param name="constantSourceList">Sources of the constant expression upon return, if any.</param> /// <param name="expressionConstant">The expression constant upon return.</param> public static bool ResolveCompilerReferences(IManifestStringExpression node, IErrorList errorList, out IResultType resolvedResult, out IResultException resolvedException, out ISealableList <IExpression> constantSourceList, out ILanguageConstant expressionConstant) { resolvedResult = null; resolvedException = null; constantSourceList = new SealableList <IExpression>(); expressionConstant = NeutralLanguageConstant.NotConstant; IClass EmbeddingClass = node.EmbeddingClass; string ValidText = node.ValidText.Item; if (!Expression.IsLanguageTypeAvailable(LanguageClasses.String.Guid, node, out ITypeName StringTypeName, out ICompiledType StringType)) { errorList.AddError(new ErrorStringTypeMissing(node)); return(false); } resolvedResult = new ResultType(StringTypeName, StringType, string.Empty); resolvedException = new ResultException(); expressionConstant = new StringLanguageConstant(ValidText); #if COVERAGE Debug.Assert(!node.IsComplex); #endif return(true); }
/// <summary> /// Compares two expressions. /// </summary> /// <param name="other">The other expression.</param> protected bool IsExpressionEqual(IManifestStringExpression other) { Debug.Assert(other != null); bool Result = true; Result &= ValidText.Item == other.ValidText.Item; return(Result); }
/// <summary> /// Initializes a new instance of the <see cref="CSharpManifestStringExpression"/> class. /// </summary> /// <param name="context">The creation context.</param> /// <param name="source">The Easly expression from which the C# expression is created.</param> protected CSharpManifestStringExpression(ICSharpContext context, IManifestStringExpression source) : base(context, source) { }
/// <summary> /// Creates a new C# expression. /// </summary> /// <param name="context">The creation context.</param> /// <param name="source">The Easly expression from which the C# expression is created.</param> public static ICSharpManifestStringExpression Create(ICSharpContext context, IManifestStringExpression source) { return(new CSharpManifestStringExpression(context, source)); }
/// <summary></summary> protected virtual void GenerateCompilerVersion() { CompilerVersion = new ManifestStringExpression("Easly 1"); }