Examples of parseProgram()


Examples of com.google.javascript.jscomp.parsing.parser.Parser.parseProgram()

        new Es6ErrorReporter(errorReporter, file, config);
    com.google.javascript.jscomp.parsing.parser.Parser.Config es6config =
        new com.google.javascript.jscomp.parsing.parser.Parser.Config(mode(
            config.languageMode));
    Parser p = new Parser(es6config, es6ErrorReporter, file);
    ProgramTree tree = p.parseProgram();
    Node root = null;
    List<Comment> comments = ImmutableList.of();
    if (tree != null && (!es6ErrorReporter.hadError() || config.isIdeMode)) {
      root = NewIRFactory.transformTree(
          tree, sourceFile, sourceString, config, errorReporter);
View Full Code Here

Examples of macromedia.asc.parser.Parser.parseProgram()

      }
    };
    cx.setHandler(newHandler);
    cx.scriptAssistParsing = true;
    Parser parser = new Parser(cx, s, "Expression"); //$NON-NLS-1$
    ProgramNode programNode = parser.parseProgram();

    if (errors.size() > 0) {
      ErrorInfo firstError = errors.get(0);
      throw new ParseException(firstError.msg, firstError.col);
    }
View Full Code Here

Examples of macromedia.asc.parser.Parser.parseProgram()

        if (ctx == null) return;

        try
        {
            Parser parser = new Parser(ctx, src, filespec);
            /*ProgramNode pn =*/ parser.parseProgram();
            Thread.sleep(50);
            System.out.println("(ash) Done");
        }
        catch (InterruptedException tex)
        {
View Full Code Here

Examples of macromedia.asc.parser.Parser.parseProgram()

        {
            BufferedInputStream stream = new BufferedInputStream(new FileInputStream(filespec));
            try
            {
                Parser parser = new Parser(ctx, stream, filespec);
                /*ProgramNode pn =*/ parser.parseProgram();
                Thread.sleep(50);
                System.out.println("(ash) Done");
            }
            catch (InterruptedException tex)
            {
View Full Code Here

Examples of org.apache.marmotta.kiwi.reasoner.parser.KWRLProgramParser.parseProgram()

    }

    @Test
    public void testStoreLoadProgram() throws Exception {
        KWRLProgramParserBase parser = new KWRLProgramParser(repository.getValueFactory(), this.getClass().getResourceAsStream("test-001.kwrl"));
        Program p = parser.parseProgram();
        p.setName("test-001");

        KiWiReasoningConnection connection = rpersistence.getConnection();
        try {
            // should not throw an exception and the program should have a database ID afterwards
View Full Code Here

Examples of org.apache.marmotta.kiwi.reasoner.parser.KWRLProgramParser.parseProgram()

     * Test storing and then updating a program (by removing two rules)
     */
    @Test
    public void testUpdateProgram() throws Exception {
        KWRLProgramParserBase parser = new KWRLProgramParser(repository.getValueFactory(), this.getClass().getResourceAsStream("test-001.kwrl"));
        Program p = parser.parseProgram();
        p.setName("test-001");

        KiWiReasoningConnection connection = rpersistence.getConnection();
        try {
            // should not throw an exception and the program should have a database ID afterwards
View Full Code Here

Examples of org.apache.marmotta.kiwi.reasoner.parser.KWRLProgramParser.parseProgram()

        KiWiReasoningConnection connection = rpersistence.getConnection();
        try {
            List<Program> programs = new ArrayList<Program>();
            for(String name : new String[] {"test-001", "test-002", "test-003", "test-004"}) {
                KWRLProgramParserBase parser = new KWRLProgramParser(repository.getValueFactory(), this.getClass().getResourceAsStream(name+".kwrl"));
                Program p = parser.parseProgram();
                p.setName(name);
                connection.storeProgram(p);
                connection.commit();

                programs.add(p);
View Full Code Here

Examples of org.apache.marmotta.kiwi.reasoner.parser.KWRLProgramParser.parseProgram()

        // store a program, very simple transitive and symmetric rules:
        // ($1 ex:property $2), ($2 ex:property $3) -> ($1 ex:property $3)
        // ($1 ex:symmetric $2) -> ($2 ex:symmetric $1)
        KWRLProgramParserBase parser = new KWRLProgramParser(repository.getValueFactory(), this.getClass().getResourceAsStream("simple.kwrl"));
        Program p = parser.parseProgram();
        p.setName("simple");

        KiWiReasoningConnection connection = rpersistence.getConnection();
        try {
            // should not throw an exception and the program should have a database ID afterwards
View Full Code Here

Examples of org.apache.marmotta.kiwi.reasoner.parser.KWRLProgramParser.parseProgram()

     * @throws SailException  in case the program already exists
     * @throws ParseException in case the program cannot be parsed
     */
    public void addProgram(String name, InputStream data) throws IOException, SailException, ParseException {
        KWRLProgramParserBase parser = new KWRLProgramParser(getValueFactory(), data);
        Program p = parser.parseProgram();
        p.setName(name);

        addProgram(p);
    }

View Full Code Here

Examples of org.apache.marmotta.kiwi.reasoner.parser.KWRLProgramParser.parseProgram()

     * @throws SailException  in case the program already exists
     * @throws ParseException in case the program cannot be parsed
     */
    public void updateProgram(String name, InputStream data) throws IOException, SailException, ParseException  {
        KWRLProgramParserBase parser = new KWRLProgramParser(getValueFactory(), data);
        Program p = parser.parseProgram();
        p.setName(name);

        updateProgram(p);
    }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.