Examples of FATransition


Examples of org.antlr.works.visualization.fa.FATransition

        point.addX(GContext.NODE_WIDTH+GContext.EPSILON_WIDTH);

        GDimension firstAlternativeDimension = null;

        for(int t=0; t<state.getNumberOfTransitions(); t++) {
            FATransition transition = state.transition(t);
            GLink link = getNode(state).getLink(transition);

            if(t == 0) {
                // We remember here the size of the first transition because if we find later
                // a "loop" transition, we will have to offset this "loop" by the size of the first
View Full Code Here

Examples of org.antlr.works.visualization.fa.FATransition

            } else if(state.isSingle()) {
                // Create the first node...
                GNode n1 = createNode(state);

                // ... and compute the size of the transition...
                FATransition transition = state.getFirstTransition();
                if(transition.isEpsilon()) {
                    n1.linkDimension.width = GContext.EPSILON_WIDTH;
                    n1.linkDimension.up = GContext.EPSILON_UP;
                    n1.linkDimension.down = GContext.EPSILON_DOWN;
                } else {
                    n1.linkDimension.width = GContext.getBoxWidth(transition.label);
View Full Code Here

Examples of org.antlr.works.visualization.fa.FATransition

        dimension.addWidth(GContext.EPSILON_WIDTH);

        GDimension firstTransitionDimension = null;

        for(int t=0; t<state.getNumberOfTransitions(); t++) {
            FATransition transition = state.transition(t);

            GLink link = new GLink();
            link.transition = transition;
            link.target = createNode(transition.target);
            norigin.addLink(link);
View Full Code Here

Examples of org.antlr.works.visualization.fa.FATransition

    public FAState alternativeEndState(FAState alt) {
        int counter = alt.getNumberOfTransitions()-1;
        FAState state = alt;
        while(true) {
            FATransition transition = state.getFirstTransition();
            if(transition == null)
                break;

            state = transition.target;
View Full Code Here

Examples of org.antlr.works.visualization.fa.FATransition

    public FATransition getNodeTransitionToNextNonSkippedState(GNode node, List path) {
        if(node == null)
            return null;

        List<FATransition> candidateTransitions = new ArrayList<FATransition>(node.state.transitions);
        FATransition candidate = null;
        int start = getPathIndex();

        loop:
        for(; getPathIndex() < path.size(); pathIndex = getPathIndex() + 1) {
            candidateTransitions = getTransitionsMatchingSkippedStates(candidateTransitions, path.subList(start, getPathIndex() +1));
View Full Code Here

Examples of org.antlr.works.visualization.fa.FATransition

    public void addNextElementInSameRule(List<GPathElement> elements, GNode node, GNode nextNode) {
        elements.add(GPathElement.createElement(node));

        // Use nextNode instead of nextState (previously in parameter) because nextState
        // could be null if it was skipped during optimization. nextNode cannot be null.
        FATransition t = node.state.getTransitionToStateNumber(nextNode.state.stateNumber);
        if(t == null) {
            // Probably a loop. In this case, the transition is located in the target state.
            t = nextNode.state.getTransitionToStateNumber(node.state.stateNumber);
            if(t == null) {
                // Still no transition found. This is a reference to the same rule (recursive)
View Full Code Here

Examples of org.antlr.works.visualization.fa.FATransition

            if(node.state.getFirstTransition() == null) {
                // If the node contains no transition (probably if it is at the end of a rule), then
                // ignore externalNode. We will draw only a link from node to nextNode.
            } else {
                // Find the transition that points to the external rule ref
                FATransition t = node.state.getTransitionToExternalStateRule(nextState.enclosingRule.name);
                if(t == null) {
                    System.err.println("[GGraphGroup] No transition to external state "+nextState.stateNumber+"["+nextState.enclosingRule.name+"] - using first transition by default");
                    t = node.state.getFirstTransition();
                }
                externalNode = findNodeForStateNumber(t.target.stateNumber);
            }
        }

        if(externalNode == null) {
            // Add the link between node and nextNode, ignore externalNode because it doesn't exist
            elements.add(GPathElement.createElement(node));
            elements.add(GPathElement.createLink(node, nextNode));
        } else {
            elements.add(GPathElement.createElement(node));

            // Add the link between node and externalNode.
            FATransition t = node.state.getTransitionToStateNumber(externalNode.state.stateNumber);
            elements.add(GPathElement.createElement(node.getLink(t)));
            elements.add(GPathElement.createElement(externalNode));

            // Add the link between externalNode and nextNode
            elements.add(GPathElement.createLink(externalNode, nextNode));
View Full Code Here

Examples of org.antlr.works.visualization.fa.FATransition

            GNode externalNode = null;

            if(nextNode == null) {
                // The state has probably been skipped during the graphical rendering.
                // Find the next non-skipped state.
                FATransition t = getNodeTransitionToNextNonSkippedState(node, path);
                if(t == null) {
                    // No transition found. Look in the skipped states mapping because
                    // it might be possible that the next state is in another rule but
                    // cannot be found because it has been skipped.
View Full Code Here

Examples of org.antlr.works.visualization.fa.FATransition

        if(altNum >= transitions.size()) {
            System.err.println("[GGraphGroup] Unreachable alt "+altNum+"["+state.enclosingRule.name+"] is out of bounds: "+transitions.size());
            return;
        }

        FATransition t = transitions.get(altNum);

        elements.add(GPathElement.createElement(node));
        elements.add(GPathElement.createElement(node.getLink(t)));

        /** This path has to be visible but not selectable */
 
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.