com.varankin.bnf
Class SyntacticFactor

java.lang.Object
  extended by com.varankin.bnf.SyntacticFactor

public class SyntacticFactor
extends java.lang.Object

A syntactic-factor consists of either: (a) an integer followed by a repetition-symbol followed by a syntactic-primary, or (b) a syntactic-primary.

Author:
© 2009 Nikolai Varankine

Field Summary
 SyntacticPrimary primary
          Implementing syntactic primary.
 int repeat
          Number of times enclosed syntactic primary must repeat.
 
Constructor Summary
SyntacticFactor(int aRepeat, SyntacticPrimary aPrimary)
           
SyntacticFactor(SyntacticPrimary aPrimary)
           
 
Method Summary
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

repeat

public final int repeat
Number of times enclosed syntactic primary must repeat.


primary

public final SyntacticPrimary primary
Implementing syntactic primary.

Constructor Detail

SyntacticFactor

public SyntacticFactor(int aRepeat,
                       SyntacticPrimary aPrimary)
Parameters:
aRepeat - positive number of times (factor) specified syntactic primary must repeat.
aPrimary - syntactic primary which repetitions comprise this syntactic factor.
Throws:
java.lang.NullPointerException - if syntactic primary is null.
java.lang.IllegalArgumentException - if factor is not a positive number.

SyntacticFactor

public SyntacticFactor(SyntacticPrimary aPrimary)
Parameters:
aPrimary - syntactic primary comprising this syntactic factor as single instance.
Throws:
java.lang.NullPointerException - if syntactic primary is null.
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object