Examples of SimpleNode


Examples of org.lilypondbeans.jccparser.SimpleNode

        currentNode=node;
        this.initCause(exception);
    }
       
    public ReparseException expandIncludedFile(){
        SimpleNode include=getInclude(currentNode);
       
        if(include==null)
            return this;
        else{
            String name = include.jjtGetFirstToken().next.image;
            ReparseException ex=new ReparseException("error in file "+name+"\r\t"+getMessage(),null, include.jjtGetFirstToken(), null);
            name = name.replace("\"", "");
            String test = include.root.parser.getFileName();
            //exists file?
//            File fullPath = new File(new File(node.root.getFileName()).getParentFile().getAbsolutePath() + "/" + name);
  //          return fullPath.getAbsolutePath();
View Full Code Here

Examples of org.metagrid.gatekeeper.node.SimpleNode

    throws Exception
        {

        //
        // Create our node.
        final Node inner = new SimpleNode(
            new URI("urn:node.000"),
            new URI("urn:type.000")
            );

        //
        // Check we can set the secret property.
        assertEquals(
            "egertvsg",
            inner.properties().set(
                new URI("urn:test.secret"),
                "egertvsg"
                ).value()
            );

        //
        // Check we can get the secret property.
        assertEquals(
            "egertvsg",
            inner.properties().get(
                new URI("urn:test.secret")
                ).value()
            );

        //
        // Check we can set the test properties.
        assertEquals(
            "green",
            inner.properties().set(
                new URI("urn:test.frog"),
                "green"
                ).value()
            );

        //
        // Check we can get the test property.
        assertEquals(
            "green",
            inner.properties().get(
                new URI("urn:test.frog")
                ).value()
            );

        //
        // Create our protector.
        SimpleProtector protector = new SimpleProtector(
            inner.ident()
            );

        //
        // Protect the node.
        final Node outer = ProtectedNode.wrap(
            protector,
            inner
            );

        //
        // Check we can't get the test properties.
        assertThrows(
            ProtectedException.class,
            new TestBlock()
                {
                public void run()
                    throws Exception
                    {
                    outer.properties().get(
                        new URI("urn:test.frog")
                        );
                    }
                }
            );

        assertThrows(
            ProtectedException.class,
            new TestBlock()
                {
                public void run()
                    throws Exception
                    {
                    outer.properties().get(
                        new URI("urn:test.toad")
                        );
                    }
                }
            );

        //
        // Allow select on frog.
        protector.add(
            new URI("urn:test.frog"),
            ProtectedProperty.SELECT_PROPERTY_ACTION,
            SimpleProtector.Permission.ALLOW
            );

        //
        // Check we can get the frog property.
        assertEquals(
            "green",
            outer.properties().get(
                new URI("urn:test.frog")
                ).value()
            );

        //
        // Check we still can't get the other property.
        assertThrows(
            ProtectedException.class,
            new TestBlock()
                {
                public void run()
                    throws Exception
                    {
                    try {
                        outer.properties().get(
                            new URI("urn:test.toad")
                            );
                        }
                    catch (ProtectedException ouch)
                        {
                        assertEquals(
                            new URI("urn:test.toad"),
                            ouch.protector().target()
                            );
                        assertEquals(
                            outer.ident(),
                            ouch.protector().parent().target()
                            );
                        throw ouch ;
                        }
                    }
                }
            );

        //
        // Allow select and update on toad.
        protector.add(
            new URI("urn:test.toad"),
            ProtectedProperty.SELECT_PROPERTY_ACTION,
            SimpleProtector.Permission.ALLOW
            );
        protector.add(
            new URI("urn:test.toad"),
            ProtectedProperty.MODIFY_PROPERTY_ACTION,
            SimpleProtector.Permission.ALLOW
            );

        //
        // Check we can set the toad property.
        assertEquals(
            "brown",
            outer.properties().set(
                new URI("urn:test.toad"),
                "brown"
                ).value()
            );

//
// Count the inner properties.
for (Property p : inner.properties())
    {
    log.debug("Inner [" + p.type() + "][" + p.value() + "]");
    }

//
// Count the outer properties.
for (Property p : outer.properties())
    {
    log.debug("Outer [" + p.type() + "][" + p.value() + "]");
    }

        //
        // Check we get a null property.
        assertNull(
            inner.properties().get(
                new URI("urn:test.newt")
                )
            );

        //
View Full Code Here

Examples of org.objectweb.speedo.query.ejb.parser.SimpleNode

        */
        Manager miManager = mapper.getMetaInfoManager();
        if (miManager == null)
            throw new SpeedoException(
                    "A non null Meta information manager is needed");
        SimpleNode node = null;
        try {
            node = new EJBQL(new CharArrayReader(query.toCharArray()))
                    .EJBQL();
        } catch (ParseException e) {
            throw new SpeedoException(
View Full Code Here

Examples of org.objectweb.speedo.query.jdo.parser.SimpleNode

                    qd.candidateClass.getName(),
                    classLoader);
        } catch (Exception e) {
            throw new SpeedoException(e);
        }
        SimpleNode node = null;
        try {
            node = new SpeedoQL(new CharArrayReader(filter.toCharArray())).SpeedoQL();
        } catch (ParseException e) {
            throw new SpeedoException(
                    "Impossible to parse the filter and to create AST", e);
View Full Code Here

Examples of org.python.parser.SimpleNode

    }

    public static PyCode compile_flags(InputStream istream, String filename,
                                 String type,CompilerFlags cflags)
    {
        SimpleNode node = parser.parse(istream, type, filename, cflags);
        boolean printResults = false;
        if (type.equals("single"))
            printResults = true;
        return Py.compile_flags(node, getName(), filename, true, printResults,
                                cflags);
View Full Code Here

Examples of org.python.pydev.parser.jython.SimpleNode

        if (found != null && found.defined && found.token instanceof SourceToken) {
            nameToken = (SourceToken) found.token;
            String rep = nameToken.getRepresentation();

            ArrayList<IDefinition> definition = new ArrayList<IDefinition>();
            SimpleNode ast = nameToken.getAst();
            try {
                PyRefactoringFindDefinition.findActualDefinition(null, this.current, rep, definition, ast.beginLine,
                        ast.beginColumn, this.nature, this.completionCache);
            } catch (Exception e) {
                Log.log(e);
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.