示例#1
0
 /// <summary>
 /// Creates a new <see cref="PreprocessorCEqualityExp"/> with the <paramref name="preCEqualityExp"/>,
 /// <paramref name="preCPrimary"/>, <paramref name="termIsEq"/>, <paramref name="column"/>,
 /// <paramref name="line"/>, and <paramref name="position"/> provided.
 /// </summary>
 /// <param name="termIsEq">Whether the term encountered is '==' (true) or '!=' (false).</param>
 /// <param name="preCEqualityExp">The previous <see cref="IPreprocessorCEqualityExp"/>.</param>
 /// <param name="preCPrimary">The <see cref="IPreprocessorCPrimary"/>
 /// that is next.</param>
 /// <remarks>Rule 1 or 2</remarks>
 /// <param name="column">The column at the current <paramref name="line"/> the
 /// <see cref="PreprocessorCEqualityExp"/> was declared at. </param>
 /// <param name="line">The line index the <see cref="PreprocessorCEqualityExp"/> was declared at.</param>
 /// <param name="position">The position in the file the <see cref="PreprocessorCEqualityExp"/>
 /// was declared at.</param>
 public PreprocessorCEqualityExp(IPreprocessorCEqualityExp preCEqualityExp, bool termIsEq, IPreprocessorCPrimary preCPrimary, int column, int line, long position)
     : base(column, line, position)
 {
     rule                 = (termIsEq ? 1 : 2);
     this.preCPrimary     = preCPrimary;
     this.preCEqualityExp = preCEqualityExp;
 }
示例#2
0
        internal static object Evaluate(this IPreprocessorCPrimary expression, IOilexerGrammarProductionRuleEntry currentEntry, IList <IOilexerGrammarTokenEntry> availableStock, ProductionRuleTemplateArgumentSeries argumentLookup, IOilexerGrammarProductionRuleTemplateEntry entry, OilexerGrammarFile file, ICompilerErrorCollection errors)
        {
            switch (expression.Rule)
            {
            case 1:
                return(expression.String);

            case 2:
                return(expression.Char);

            case 3:
                return(expression.PreCLogicalOrExp.Evaluate(currentEntry, availableStock, argumentLookup, entry, file, errors));

            case 4:
                return(expression.Identifier.Name);

            case 5:
                return(expression.Number);
            }
            return(null);
        }
示例#3
0
 /// <summary>
 /// Creates a new <see cref="PreprocessorCEqualityExp"/> with the
 /// <paramref name="preCPrimary"/>, <paramref name="column"/>,
 /// <paramref name="line"/>, and <paramref name="position"/> provided.
 /// </summary>
 /// <param name="preCPrimary">The <see cref="IPreprocessorCPrimary"/>
 /// that is next.</param>
 /// <remarks>Rule 3</remarks>
 /// <param name="column">The column at the current <paramref name="line"/> the
 /// <see cref="PreprocessorCEqualityExp"/> was declared at. </param>
 /// <param name="line">The line index the <see cref="PreprocessorCEqualityExp"/> was declared at.</param>
 /// <param name="position">The position in the file the <see cref="PreprocessorCEqualityExp"/>
 /// was declared at.</param>
 public PreprocessorCEqualityExp(IPreprocessorCPrimary preCPrimary, int column, int line, long position)
     : base(column, line, position)
 {
     this.preCPrimary = preCPrimary;
     this.rule        = 3;
 }