Exemplo n.º 1
0
 internal void ReclassifyToken(OilexerGrammarTokens.IdentifierToken identifierToken, IOilexerGrammarProductionRuleEntry primary)
 {
     if (reclassifications.ContainsKey(identifierToken))
     {
         return;
     }
     reclassifications.Add(identifierToken, OilexerGrammarTokenType.RuleReference);
 }
Exemplo n.º 2
0
 protected override void DefineRuleSoftReference(OilexerGrammarTokens.IdentifierToken primary, OilexerGrammarTokens.IdentifierToken secondary = null)
 {
     primary.SetTokenType(OilexerGrammarTokenType.SoftReference);
     if (secondary != null)
     {
         secondary.SetTokenType(OilexerGrammarTokenType.SoftReference);
     }
 }
Exemplo n.º 3
0
 internal void ReclassifyToken(OilexerGrammarTokens.IdentifierToken identifierToken, IProductionRuleTemplatePart item)
 {
     if (reclassifications.ContainsKey(identifierToken))
     {
         return;
     }
     reclassifications.Add(identifierToken, OilexerGrammarTokenType.RuleTemplateParameterReference);
 }
Exemplo n.º 4
0
 internal void ReclassifyToken(OilexerGrammarTokens.IdentifierToken identifierToken, ITokenItem primary)
 {
     if (reclassifications.ContainsKey(identifierToken))
     {
         return;
     }
     if (primary is ILiteralCharTokenItem)
     {
         reclassifications.Add(identifierToken, OilexerGrammarTokenType.CharacterLiteral);
     }
     else if (primary is ILiteralStringTokenItem)
     {
         reclassifications.Add(identifierToken, OilexerGrammarTokenType.StringLiteral);
     }
 }
Exemplo n.º 5
0
        internal void ReclassifyToken(OilexerGrammarTokens.IdentifierToken identifier, ReclassificationKind reclassificationKind)
        {
            if (reclassifications.ContainsKey(identifier))
            {
                return;
            }
            switch (reclassificationKind)
            {
            case ReclassificationKind.Keyword:
            case ReclassificationKind.NativeMethod:
                reclassifications.Add(identifier, OilexerGrammarTokenType.Keyword);
                break;

            default:
                break;
            }
        }
Exemplo n.º 6
0
 protected override void DefineRuleTemplateParameterIdentifier(OilexerGrammarTokens.IdentifierToken id, IProductionRuleTemplatePart currentPart)
 {
     this.Handler.ReclassifyToken(id, currentPart);
 }
Exemplo n.º 7
0
 protected override void DefineRuleTemplateIdentifier(OilexerGrammarTokens.IdentifierToken ruleTemplateIdentifier, IOilexerGrammarProductionRuleTemplateEntry ruleTemplateEntry)
 {
     this.Handler.ReclassifyToken(ruleTemplateIdentifier, ruleTemplateEntry);
 }
Exemplo n.º 8
0
 protected override void DefineTokenIdentifier(OilexerGrammarTokens.IdentifierToken tokenIdentifier, IOilexerGrammarTokenEntry tokenEntry)
 {
     this.Handler.ReclassifyToken(tokenIdentifier, tokenEntry);
 }
Exemplo n.º 9
0
 protected override void DefineCommandIdentifier(OilexerGrammarTokens.IdentifierToken commandIdentifier)
 {
     this.Handler.ReclassifyToken(commandIdentifier, ReclassificationKind.NativeMethod);
 }
Exemplo n.º 10
0
 protected override void DefineKeywordIdentifier(OilexerGrammarTokens.IdentifierToken keywordIdentifier)
 {
     this.Handler.ReclassifyToken(keywordIdentifier, ReclassificationKind.Keyword);
 }
Exemplo n.º 11
0
 /// <summary>
 /// Creates a new <see cref="PreprocessorCExp"/> with the <paramref name="identifier"/>,
 /// <paramref name="column"/>,  <paramref name="line"/>, and <paramref name="position"/>.
 /// </summary>
 /// <param name="identifier">The identifier represented by the <see cref="PreprocessorCExp"/></param>
 /// <param name="column">The column at the current <paramref name="line"/> the
 /// <see cref="PreprocessorCExp"/> was declared at. </param>
 /// <param name="line">The line index the <see cref="PreprocessorCExp"/> was declared at.</param>
 /// <param name="position">The position in the file the <see cref="PreprocessorCExp"/>
 /// was declared at.</param>
 public PreprocessorCPrimary(OilexerGrammarTokens.IdentifierToken identifier, int column, int line, long position)
     : base(column, line, position)
 {
     this.rule       = 4;
     this.identifier = identifier;
 }