Package wyautl_old.lang.Automaton

Examples of wyautl_old.lang.Automaton.State


      }
      return;
    }
    onStack.set(index);
    visited.set(index);
    State state = automaton.states[index];
    for(int child : state.children) {
      findHeaders(child,visited,onStack,headers,automaton);
    }
    onStack.set(index,false);
  }
View Full Code Here


   * @return
   */
  public final static Type construct(Automaton automaton) {
    automaton = normalise(automaton);
    // second, construc the appropriate face
    State root = automaton.states[0];
    Type type;

    switch(root.kind) {
    case K_VOID:
      type = T_VOID;
View Full Code Here

   * @return
   */
  private static Type construct(byte kind, Object data, Type... children) {
    int[] nchildren = new int[children.length];
    boolean deterministic = kind != K_UNION;
    Automaton automaton = new Automaton(new State(kind, data, deterministic, nchildren));
    int start = 1;
    int i=0;
    for(Type element : children) {
      nchildren[i] = start;
      Automaton child = destruct(element);
View Full Code Here

   * @return
   */
  private static Type construct(byte kind, Object data, Collection<Type> children) {
    int[] nchildren = new int[children.size()];
    boolean deterministic = kind != K_UNION;
    Automaton automaton = new Automaton(new State(kind, data, deterministic, nchildren));
    int start = 1;
    int i=0;
    for(Type element : children) {
      nchildren[i] = start;
      Automaton child = destruct(element);
View Full Code Here

      Object data = null;
      if (t instanceof Nominal) {
        Nominal x = (Nominal) t;
        data = x.nid;
      }
      State state = new State(kind, data, true, Automaton.NOCHILDREN);
      return new Automaton(new State[] { state });
    } else {
      // compound type
      return ((Compound) t).automaton;
    }
View Full Code Here

    Compound compound = (Compound) type;
    Automaton automaton = compound.automaton;
    State[] nodes = automaton.states;
    int[] rmap = new int[nodes.length];
    for (int i = 0; i != nodes.length; ++i) {
      State c = nodes[i];
      if (c.kind == K_NOMINAL && c.data.equals(label)) {
        rmap[i] = 0;
      } else {
        rmap[i] = i;
      }
View Full Code Here

      }
      return;
    }
    onStack.set(index);
    visited.set(index);
    State state = automaton.states[index];
    for(int child : state.children) {
      findHeaders(child,visited,onStack,headers,automaton);
    }
    onStack.set(index,false);
  }
View Full Code Here

      return headers[index];
    } else if(headers[index] != null) {
      visited.set(index);
    }
    String header = headers[index];
    State state = automaton.states[index];

    switch (state.kind) {
    case Type.K_VOID:
      return "v";
    case Type.K_ANY:
View Full Code Here

TOP

Related Classes of wyautl_old.lang.Automaton.State

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.