org.dbmaintain.script.parser.parsingstate.impl
Class InCurlyBraceBlockCommentParsingState

java.lang.Object
  extended by org.dbmaintain.script.parser.parsingstate.impl.InCurlyBraceBlockCommentParsingState
All Implemented Interfaces:
ParsingState

public class InCurlyBraceBlockCommentParsingState
extends Object
implements ParsingState

A state for parsing an in-block comment (/ * comment * /) part of a script.

Author:
Tim Ducheyne, Filip Neven

Field Summary
protected  HandleNextCharacterResult backToNormalResult
          The normal parsing state, that should be returned when the comment end is reached.
protected  HandleNextCharacterResult stayInBlockCommentResult
           
 
Constructor Summary
InCurlyBraceBlockCommentParsingState()
           
 
Method Summary
 HandleNextCharacterResult getNextParsingState(Character previousChar, Character currentChar, Character nextChar, StatementBuilder statementBuilder)
          Determines whether the end of the block comment is reached.
protected  boolean isEndOfBlockComment(Character currentChar)
           
 void linkParsingStates(ParsingState normalParsingState)
          Initializes the state with the normal parsing state, that should be returned when the comment end is reached..
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

backToNormalResult

protected HandleNextCharacterResult backToNormalResult
The normal parsing state, that should be returned when the comment end is reached.


stayInBlockCommentResult

protected HandleNextCharacterResult stayInBlockCommentResult
Constructor Detail

InCurlyBraceBlockCommentParsingState

public InCurlyBraceBlockCommentParsingState()
Method Detail

linkParsingStates

public void linkParsingStates(ParsingState normalParsingState)
Initializes the state with the normal parsing state, that should be returned when the comment end is reached..

Parameters:
normalParsingState - The normal state, not null

getNextParsingState

public HandleNextCharacterResult getNextParsingState(Character previousChar,
                                                     Character currentChar,
                                                     Character nextChar,
                                                     StatementBuilder statementBuilder)
Determines whether the end of the block comment is reached. If that is the case, the normal parsing state is returned.

Specified by:
getNextParsingState in interface ParsingState
Parameters:
previousChar - The previous char, null if none
currentChar - The current char
nextChar - The next char, null if none
statementBuilder - The statement builder, not null
Returns:
The next parsing state, null if the end of the statement is reached

isEndOfBlockComment

protected boolean isEndOfBlockComment(Character currentChar)
Parameters:
currentChar - The current char
Returns:
true if the given previous and current character indicate the end of the block comment


Copyright © 2011. All Rights Reserved.