示例#1
0
        public UstNode VisitPatternId([NotNull] DslParser.PatternIdContext context)
        {
            string patternId = context.GetText();

            if (SourceLanguage.IsCaseInsensitive() && !patternId.StartsWith("(?i)"))
            {
                patternId = "(?i)" + patternId;
            }
            IdToken result = new PatternIdToken(patternId, context.GetTextSpan());

            return(result);
        }
示例#2
0
        private IdToken ProcessId(ITerminalNode idTerminal)
        {
            string  id = idTerminal.GetText();
            IdToken result;

            if (SourceLanguage.IsCaseInsensitive())
            {
                result = new PatternIdToken("(?i)^" + id + "$", idTerminal.GetTextSpan());
            }
            else
            {
                result = new IdToken(id, idTerminal.GetTextSpan(), null);
            }
            return(result);
        }