Package ptolemy.moml

Examples of ptolemy.moml.MoMLParser


                // will need to get write permission on the workspace.
                // Particularly if it is executing in a new thread, then
                // during the fire() method of this actor it would be
                // inappropriate to grant write access on the workspace
                // of this actor.
                MoMLParser parser = new MoMLParser();

                try {
                    _model = parser.parse(null, url);
                } catch (Exception ex) {
                    throw new IllegalActionException(this, ex,
                            "Failed to read model.");
                }
View Full Code Here


    public void attributeChanged(Attribute attribute)
            throws IllegalActionException {
        if (attribute == modelURL) {
            URL url = modelURL.asURL();
            if (url != null) {
                MoMLParser parser = new MoMLParser();
                try {
                    _entity = parser.parse(null, url);
                    ParserAttribute parserAttribute = new ParserAttribute(
                            _entity, "_parser");
                    parserAttribute.setParser(parser);
                } catch (Exception ex) {
                    throw new IllegalActionException(this, ex,
View Full Code Here

    /** Create a blank entity associated with this display.
     */
    private void _createBlankEntity() {
        String moml = "<entity name=\"top\" class=\"ptolemy.kernel.CompositeEntity\"/>";
        MoMLParser parser = new MoMLParser();
        try {
            _entity = parser.parse(null, moml);
            ParserAttribute parserAttribute = new ParserAttribute(_entity,
                    "_parser");
            parserAttribute.setParser(parser);
        } catch (Exception ex) {
            throw new InternalErrorException(ex);
View Full Code Here

        _createDirector();

        _moml = null;

        try {
            _parser = new MoMLParser();
            MoMLParser.setMoMLFilters(BackwardCompatibility.allFilters());

            // When no model applied, output the default value.
            if (((BooleanToken) connectPorts.getToken()).booleanValue()) {
                Const constActor = new Const(this, "Const");
View Full Code Here

                // will need to get write permission on the workspace.
                // Particularly if it is executing in a new thread, then
                // during the fire() method of this actor it would be
                // inappropriate to grant write access on the workspace
                // of this actor.
                MoMLParser parser = new MoMLParser();

                try {
                    _model = parser.parse(null, url);
                } catch (Exception ex) {
                    throw new IllegalActionException(this, ex,
                            "Failed to read model from: " + url);
                }
View Full Code Here

     */
    public static synchronized RecordToken executeModel(URL url,
            RecordToken args, String[] resultLabels)
            throws IllegalActionException {
        if (url != null) {
            MoMLParser parser = new MoMLParser();
            NamedObj model;

            try {
                model = parser.parse(null, url);
            } catch (Exception ex) {
                throw new IllegalActionException(ex
                        + "Failed to pass the model URL." + url.toString());
            }

View Full Code Here

        // join the peer group for actor exchange
        _joinPeerGroup();

        try {
            MoMLParser parser = new MoMLParser();
            MoMLParser.setMoMLFilters(BackwardCompatibility.allFilters());

            File file = new File(_configDir + "/" + _DISCOVERED_ACTORS);

            if (file.exists()) {
                _cachedLib = (CompositeEntity) parser.parse(null, file.toURI()
                        .toURL());
                _cachedLib.addChangeListener(this);
                System.out.println("create a compositeActor entity "
                        + "from discoveredActors.xml");
            } else {
View Full Code Here

    public boolean loadMoML(String moml) throws java.rmi.RemoteException {
        if (VERBOSE) {
            System.out.println("Loading: " + moml);
        }

        momlParser = new MoMLParser(new Workspace());
        compositeActor = null;

        String processedMoML = processMoML(moml);

        try {
View Full Code Here

        // following the comments in MoMLApplication, use the same URL for
        // the two arguments (base and URL) to parse(). Also, a instance
        // of MoMLParser must be used to parse each file, otherwise
        // the same automaton will be returned the second time parse() is
        // called.
        MoMLParser parser = new MoMLParser();
        InterfaceAutomaton automaton = (InterfaceAutomaton) parser.parse(url,
                url);
        automaton.addPorts();

        System.out.println("Deadlock states:");
View Full Code Here

        // following the comments in MoMLApplication, use the same URL for
        // the two arguments (base and URL) to parse(). Also, a instance
        // of MoMLParser must be used to parse each file, otherwise
        // the same automaton will be returned the second time parse() is
        // called.
        MoMLParser parser = new MoMLParser();
        InterfaceAutomaton automaton = (InterfaceAutomaton) parser.parse(url,
                url);
        automaton.addPorts();

        automaton.combineInternalTransitions();
View Full Code Here

TOP

Related Classes of ptolemy.moml.MoMLParser

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.