edu.neu.ccs.demeterf.lexer.classes
Class NFA

java.lang.Object
  extended by edu.neu.ccs.demeterf.lexer.classes.NFA

public class NFA
extends java.lang.Object

Representation of NFA


Nested Class Summary
static class NFA.fin
          Field Class for NFA.fin
static class NFA.start
          Field Class for NFA.start
static class NFA.trans
          Field Class for NFA.trans
 
Constructor Summary
NFA(State start, State fin, List<Trans> trans)
          Construct a(n) NFA Instance
 
Method Summary
 NFA addTrans(Label l)
           
 NFA addTrans(Label l, State s, State f)
           
static Set<State> closure(Set<State> start, List<Trans> eps)
           
static NFA concat(List<NFA> nfas)
           
 NFA concat(NFA nfa)
           
 Set<State> DFAEdge(Set<State> s, char c, List<Trans> eps)
           
static NFA empty()
           
 List<Trans> epsilons()
           
 boolean equals(java.lang.Object o)
          Is the given object Equal to this NFA?
 State getFin()
          Getter for field NFA.fin
 State getStart()
          Getter for field NFA.start
 List<Trans> getTrans()
          Getter for field NFA.trans
 NFA huh()
           
static NFA or(List<NFA> nfas)
           
 NFA or(NFA nfa)
           
static NFA parse(java.io.InputStream inpt)
          Parse an instance of NFA from the given Stream
static NFA parse(java.io.Reader inpt)
          Parse an instance of NFA from the given Reader
static NFA parse(java.lang.String inpt)
          Parse an instance of NFA from the given String
 NFA rawOr(NFA nfa)
           
 NFA rmdups()
           
 NFA star()
           
 java.lang.String toString()
          DGP method from Class PrintToString
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NFA

public NFA(State start,
           State fin,
           List<Trans> trans)
Construct a(n) NFA Instance

Method Detail

equals

public boolean equals(java.lang.Object o)
Is the given object Equal to this NFA?

Overrides:
equals in class java.lang.Object

parse

public static NFA parse(java.lang.String inpt)
                 throws ParseException
Parse an instance of NFA from the given String

Throws:
ParseException

parse

public static NFA parse(java.io.InputStream inpt)
                 throws ParseException
Parse an instance of NFA from the given Stream

Throws:
ParseException

parse

public static NFA parse(java.io.Reader inpt)
                 throws ParseException
Parse an instance of NFA from the given Reader

Throws:
ParseException

empty

public static NFA empty()

concat

public static NFA concat(List<NFA> nfas)

concat

public NFA concat(NFA nfa)

or

public static NFA or(List<NFA> nfas)

or

public NFA or(NFA nfa)

rawOr

public NFA rawOr(NFA nfa)

addTrans

public NFA addTrans(Label l,
                    State s,
                    State f)

addTrans

public NFA addTrans(Label l)

star

public NFA star()

huh

public NFA huh()

rmdups

public NFA rmdups()

DFAEdge

public Set<State> DFAEdge(Set<State> s,
                          char c,
                          List<Trans> eps)

epsilons

public List<Trans> epsilons()

closure

public static Set<State> closure(Set<State> start,
                                 List<Trans> eps)

toString

public java.lang.String toString()
DGP method from Class PrintToString

Overrides:
toString in class java.lang.Object

getTrans

public List<Trans> getTrans()
Getter for field NFA.trans


getFin

public State getFin()
Getter for field NFA.fin


getStart

public State getStart()
Getter for field NFA.start