예제 #1
0
        public override void VisitCompoundSymbol(CompoundSymbol compoundSymbol)
        {
            string symValue = compoundSymbol.Value;

            if (symValue.StartsWith("\""))
            {
                symValue = symValue.Substring(1);
            }

            if (symValue.EndsWith("\""))
            {
                symValue = symValue.Substring(0, symValue.Length - 1);
            }

            sb.AppendFormat("\"{0}\"", EscapeString(symValue));
        }
예제 #2
0
파일: Parser.cs 프로젝트: yallie/refal
        static void Symbol(out Symbol symbol)
        {
            symbol = null;
            switch (la.kind)
            {
            case 2: {
                Get();
                symbol = new CompoundSymbol(t.val);
                break;
            }

            case 3: {
                Get();
                symbol = new Character(t.val);
                break;
            }

            case 4: {
                Get();
                symbol = new Macrodigit(Convert.ToInt32(t.val));
                break;
            }

            case 14: {
                Get();
                symbol = new TrueIdentifier(t.val);
                break;
            }

            case 15: {
                Get();
                symbol = new FalseIdentifier(t.val);
                break;
            }

            case 1: {
                Get();
                symbol = new Identifier(t.val);
                break;
            }

            default: SynErr(42); break;
            }
        }
예제 #3
0
 public abstract void VisitCompoundSymbol(CompoundSymbol compoundSymbol);
예제 #4
0
 public override void VisitCompoundSymbol(CompoundSymbol compoundSymbol)
 {
     sb.Append(compoundSymbol.Value);
 }
예제 #5
0
 public override void VisitCompoundSymbol(CompoundSymbol compoundSymbol)
 {
     throw new NotImplementedException();
 }