Package com.sun.tools.javac.parser

Examples of com.sun.tools.javac.parser.Parser


        JavaFileObject prev = compiler.log.useSource(null);
        ParserFactory parserFactory = ParserFactory.instance(context);
        Attr attr = Attr.instance(context);
        try {
            CharBuffer buf = CharBuffer.wrap((expr+"\u0000").toCharArray(), 0, expr.length());
            Parser parser = parserFactory.newParser(buf, false, false, false);
            JCTree tree = parser.parseType();
            return attr.attribType(tree, (Symbol.TypeSymbol)scope);
        } finally {
            compiler.log.useSource(prev);
        }
    }
View Full Code Here


        JavaFileObject prev = compiler.log.useSource(null);
        ParserFactory parserFactory = ParserFactory.instance(context);
        Attr attr = Attr.instance(context);
        try {
            CharBuffer buf = CharBuffer.wrap((expr+"\u0000").toCharArray(), 0, expr.length());
            Parser parser = parserFactory.newParser(buf, false, false, false);
            JCTree tree = parser.parseType();
            return attr.attribType(tree, (Symbol.TypeSymbol)scope);
        } finally {
            compiler.log.useSource(prev);
        }
    }
View Full Code Here

        Parser.Factory parserFactory = Parser.Factory.instance(context);
        Attr attr = Attr.instance(context);
        try {
            Scanner scanner = scannerFactory.newScanner((expr+"\u0000").toCharArray(),
                                                        expr.length());
            Parser parser = parserFactory.newParser(scanner, false, false);
            JCTree tree = parser.type();
            return attr.attribType(tree, (Symbol.TypeSymbol)scope);
        } finally {
            compiler.log.useSource(prev);
        }
    }
View Full Code Here

            + "}\n";
        JavaFileObject fo = new StringJavaFileObject("Foo", text);
        log.useSource(fo);

        Scanner s = sfac.newScanner(fo.getCharContent(true));
        Parser parser = pfac.newParser(s, false, genEndPos);
        JCTree.JCCompilationUnit tree = parser.compilationUnit();
        log.setEndPosTable(fo, tree.endPositions);

        TreeScanner ts = new LogTester(log, tree.endPositions);
        ts.scan(tree);
View Full Code Here

        Parser.Factory parserFactory = Parser.Factory.instance(context);
        Attr attr = Attr.instance(context);
        try {
            Scanner scanner = scannerFactory.newScanner((expr+"\u0000").toCharArray(),
                                                        expr.length());
            Parser parser = parserFactory.newParser(scanner, false, false);
            JCTree tree = parser.type();
            return attr.attribType(tree, (Symbol.TypeSymbol)scope);
        } finally {
            compiler.log.useSource(prev);
        }
    }
View Full Code Here

        Parser.Factory parserFactory = Parser.Factory.instance(context);
        Attr attr = Attr.instance(context);
        try {
            Scanner scanner = scannerFactory.newScanner((expr+"\u0000").toCharArray(),
                                                        expr.length());
            Parser parser = parserFactory.newParser(scanner, false, false);
            JCTree tree = parser.type();
            return attr.attribType(tree, (Symbol.TypeSymbol)scope);
        } finally {
            compiler.log.useSource(prev);
        }
    }
View Full Code Here

        JavaFileObject prev = compiler.log.useSource(null);
        ParserFactory parserFactory = ParserFactory.instance(context);
        Attr attr = Attr.instance(context);
        try {
            CharBuffer buf = CharBuffer.wrap((expr+"\u0000").toCharArray(), 0, expr.length());
            Parser parser = parserFactory.newParser(buf, false, false, false);
            JCTree tree = parser.parseType();
            return attr.attribType(tree, (Symbol.TypeSymbol)scope);
        } finally {
            compiler.log.useSource(prev);
        }
    }
View Full Code Here

            + "}\n";
        JavaFileObject fo = new StringJavaFileObject("Foo", text);
        log.useSource(fo);

        CharSequence cs = fo.getCharContent(true);
        Parser parser = pfac.newParser(cs, false, genEndPos, false);
        JCTree.JCCompilationUnit tree = parser.parseCompilationUnit();
        log.setEndPosTable(fo, tree.endPositions);

        TreeScanner ts = new LogTester(log, tree.endPositions);
        ts.scan(tree);
View Full Code Here

            + "}\n";
        JavaFileObject fo = new StringJavaFileObject("Foo", text);
        log.useSource(fo);

        Scanner s = sfac.newScanner(fo.getCharContent(true));
        Parser parser = pfac.newParser(s, false, genEndPos);
        JCTree.JCCompilationUnit tree = parser.compilationUnit();
        log.setEndPosTable(fo, tree.endPositions);

        TreeScanner ts = new LogTester(log, tree.endPositions);
        ts.scan(tree);
View Full Code Here

        Parser.Factory parserFactory = Parser.Factory.instance(context);
        Attr attr = Attr.instance(context);
        try {
            Scanner scanner = scannerFactory.newScanner((expr+"\u0000").toCharArray(),
                                                        expr.length());
            Parser parser = parserFactory.newParser(scanner, false, false);
            JCTree tree = parser.type();
            return attr.attribType(tree, (Symbol.TypeSymbol)scope);
        } finally {
            compiler.log.useSource(prev);
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.tools.javac.parser.Parser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.