Package org.codehaus.mojo.natives.parser
Class CobolLineStartState
- java.lang.Object
-
- org.codehaus.mojo.natives.parser.AbstractParserState
-
- org.codehaus.mojo.natives.parser.CobolLineStartState
-
public final class CobolLineStartState extends AbstractParserState
The state at the start of a COBOL line, which matches the first letter of a COPY directive.Leading spaces, tabs and digits are skipped so that fixed format sources carrying a sequence number in columns 1 to 6 are handled alongside sources that omit it. Any other character ends the line as far as this parser is concerned, which is what keeps comment lines out: the indicator in column 7 of a commented line is "*" or "/", neither of which is skipped.
-
-
Constructor Summary
Constructors Constructor Description CobolLineStartState(AbstractParser parser, char matchLetter, AbstractParserState nextStateArg)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractParserStateconsume(char ch)Consumes a character and returns the next state for the parser.-
Methods inherited from class org.codehaus.mojo.natives.parser.AbstractParserState
getParser
-
-
-
-
Constructor Detail
-
CobolLineStartState
public CobolLineStartState(AbstractParser parser, char matchLetter, AbstractParserState nextStateArg)
Constructor.- Parameters:
parser- parsermatchLetter- letter to matchnextStateArg- next state if a match on the letter
-
-
Method Detail
-
consume
public AbstractParserState consume(char ch)
Consumes a character and returns the next state for the parser.- Specified by:
consumein classAbstractParserState- Parameters:
ch- next character- Returns:
- the configured nextState on a match, this state while skipping the sequence area, the new line state on an end of line, or null to abandon the rest of the line
-
-