org.eclipse.jdt.internal.compiler.parser
Class AbstractCommentParser

java.lang.Object
  extended by org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser
All Implemented Interfaces:
JavadocTagConstants
Direct Known Subclasses:
JavadocParser

public abstract class AbstractCommentParser
extends Object
implements JavadocTagConstants

Parser specialized for decoding javadoc comments


Field Summary
protected  boolean abort
           
protected static int ARGUMENT_RECOVERY
           
protected static int ARGUMENT_TYPE_RECOVERY
           
protected static int AST_STACK_INCREMENT
           
protected  int astLengthPtr
           
protected  int[] astLengthStack
           
protected  int astPtr
           
protected  Object[] astStack
           
 boolean checkDocComment
           
static int COMPIL_PARSER
           
static int COMPLETION_PARSER
           
protected  long complianceLevel
           
protected  boolean deprecated
           
static int DOM_PARSER
           
protected static int EMPTY_ARGUMENT_RECOVERY
           
protected  int firstTagPosition
           
static int FORMATTER_COMMENT_PARSER
           
protected  int identifierLengthPtr
           
protected  int[] identifierLengthStack
           
protected  long[] identifierPositionStack
           
protected  int identifierPtr
           
protected  char[][] identifierStack
           
protected  int index
           
protected  long[] inheritedPositions
           
protected  int inheritedPositionsPtr
           
protected  int inlineTagStart
           
protected  boolean inlineTagStarted
           
protected  int javadocEnd
           
protected  int javadocStart
           
protected  int javadocTextEnd
           
protected  int javadocTextStart
           
protected  int kind
           
protected  int lastBlockTagValue
           
protected  int lastIdentifierEndPosition
           
protected  int lineEnd
           
protected  int[] lineEnds
           
protected  boolean lineStarted
           
protected  int memberStart
           
protected static int PARSER_KIND
           
protected static int QUALIFIED_NAME_RECOVERY
           
 boolean reportProblems
           
protected  Object returnStatement
           
 Scanner scanner
           
static int SELECTION_PARSER
           
 boolean setJavadocPositions
           
 char[] source
           
static int SOURCE_PARSER
           
protected  long sourceLevel
           
protected  Parser sourceParser
           
protected  int starPosition
           
protected  int tagSourceEnd
           
protected  int tagSourceStart
           
protected  int tagValue
           
protected static int TEXT_PARSE
           
protected static int TEXT_VERIF
           
protected  int textStart
           
protected  int tokenPreviousPosition
           
 
Fields inherited from interface org.eclipse.jdt.internal.compiler.parser.JavadocTagConstants
ALL_TAGS_LENGTH, BLOCK_IDX, BLOCK_TAGS, BLOCK_TAGS_LENGTH, CLASS_TAGS, COMPILATION_UNIT_TAGS, FIELD_TAGS, HREF_TAG, INLINE_IDX, INLINE_TAGS, INLINE_TAGS_LENGTH, JAVADOC_TAG_TYPE, METHOD_TAGS, NO_TAG_VALUE, ORDERED_TAGS_NUMBER, PACKAGE_TAGS, PARAM_TAG_EXPECTED_ORDER, SEE_TAG_EXPECTED_ORDER, TAG_AUTHOR, TAG_AUTHOR_LENGTH, TAG_AUTHOR_VALUE, TAG_CATEGORY, TAG_CATEGORY_LENGTH, TAG_CATEGORY_VALUE, TAG_CODE, TAG_CODE_LENGTH, TAG_CODE_VALUE, TAG_DEPRECATED, TAG_DEPRECATED_LENGTH, TAG_DEPRECATED_VALUE, TAG_DOC_ROOT, TAG_DOC_ROOT_LENGTH, TAG_DOC_ROOT_VALUE, TAG_EXCEPTION, TAG_EXCEPTION_LENGTH, TAG_EXCEPTION_VALUE, TAG_INHERITDOC, TAG_INHERITDOC_LENGTH, TAG_INHERITDOC_VALUE, TAG_LINK, TAG_LINK_LENGTH, TAG_LINK_VALUE, TAG_LINKPLAIN, TAG_LINKPLAIN_LENGTH, TAG_LINKPLAIN_VALUE, TAG_LITERAL, TAG_LITERAL_LENGTH, TAG_LITERAL_VALUE, TAG_NAMES, TAG_OTHERS_VALUE, TAG_PARAM, TAG_PARAM_LENGTH, TAG_PARAM_VALUE, TAG_RETURN, TAG_RETURN_LENGTH, TAG_RETURN_VALUE, TAG_SEE, TAG_SEE_LENGTH, TAG_SEE_VALUE, TAG_SERIAL, TAG_SERIAL_DATA, TAG_SERIAL_DATA_LENGTH, TAG_SERIAL_DATA_VALUE, TAG_SERIAL_FIELD, TAG_SERIAL_FIELD_LENGTH, TAG_SERIAL_FIELD_VALUE, TAG_SERIAL_LENGTH, TAG_SERIAL_VALUE, TAG_SINCE, TAG_SINCE_LENGTH, TAG_SINCE_VALUE, TAG_THROWS, TAG_THROWS_LENGTH, TAG_THROWS_VALUE, TAG_TYPE_BLOCK, TAG_TYPE_INLINE, TAG_TYPE_NONE, TAG_VALUE, TAG_VALUE_LENGTH, TAG_VALUE_VALUE, TAG_VERSION, TAG_VERSION_LENGTH, TAG_VERSION_VALUE, THROWS_TAG_EXPECTED_ORDER
 
Constructor Summary
protected AbstractCommentParser(Parser sourceParser)
           
 
Method Summary
protected  boolean commentParse()
           
protected  void consumeToken()
           
protected abstract  Object createArgumentReference(char[] name, int dim, boolean isVarargs, Object typeRef, long[] dimPos, long argNamePos)
           
protected  boolean createFakeReference(int start)
           
protected abstract  Object createFieldReference(Object receiver)
           
protected abstract  Object createMethodReference(Object receiver, List arguments)
           
protected  Object createReturnStatement()
           
protected abstract  void createTag()
           
protected abstract  Object createTypeReference(int primitiveToken)
           
protected  int getCurrentTokenType()
           
protected  Object parseArguments(Object receiver)
           
protected  boolean parseHref()
           
protected  boolean parseHtmlTag(int previousPosition, int endTextPosition)
          Parse a possible HTML tag like: <code> <br> <h?> Note that the default is to do nothing!
protected  boolean parseIdentifierTag(boolean report)
           
protected  Object parseMember(Object receiver)
           
protected  boolean parseParam()
           
protected  Object parseQualifiedName(boolean reset)
           
protected  boolean parseReference()
           
protected abstract  boolean parseTag(int previousPosition)
           
protected  boolean parseThrows()
           
protected  char peekChar()
           
protected  void pushIdentifier(boolean newLength, boolean isToken)
           
protected  void pushOnAstStack(Object node, boolean newLength)
           
protected abstract  boolean pushParamName(boolean isTypeParam)
           
protected abstract  boolean pushSeeRef(Object statement)
           
protected  void pushText(int start, int end)
           
protected abstract  boolean pushThrowName(Object typeRef)
           
protected  char readChar()
           
protected  int readToken()
           
protected  int readTokenAndConsume()
           
protected  int readTokenSafely()
           
protected  void recordInheritedPosition(long position)
           
protected  void refreshInlineTagPosition(int previousPosition)
           
protected  void refreshReturnStatement()
           
protected  void setInlineTagStarted(boolean started)
           
protected  Object syntaxRecoverQualifiedName(int primitiveToken)
           
 String toString()
           
protected abstract  void updateDocComment()
           
protected  void updateLineEnd()
           
protected  boolean verifyEndLine(int textPosition)
           
protected  boolean verifySpaceOrEndComment()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMPIL_PARSER

public static final int COMPIL_PARSER
See Also:
Constant Field Values

DOM_PARSER

public static final int DOM_PARSER
See Also:
Constant Field Values

SELECTION_PARSER

public static final int SELECTION_PARSER
See Also:
Constant Field Values

COMPLETION_PARSER

public static final int COMPLETION_PARSER
See Also:
Constant Field Values

SOURCE_PARSER

public static final int SOURCE_PARSER
See Also:
Constant Field Values

FORMATTER_COMMENT_PARSER

public static final int FORMATTER_COMMENT_PARSER
See Also:
Constant Field Values

PARSER_KIND

protected static final int PARSER_KIND
See Also:
Constant Field Values

TEXT_PARSE

protected static final int TEXT_PARSE
See Also:
Constant Field Values

TEXT_VERIF

protected static final int TEXT_VERIF
See Also:
Constant Field Values

QUALIFIED_NAME_RECOVERY

protected static final int QUALIFIED_NAME_RECOVERY
See Also:
Constant Field Values

ARGUMENT_RECOVERY

protected static final int ARGUMENT_RECOVERY
See Also:
Constant Field Values

ARGUMENT_TYPE_RECOVERY

protected static final int ARGUMENT_TYPE_RECOVERY
See Also:
Constant Field Values

EMPTY_ARGUMENT_RECOVERY

protected static final int EMPTY_ARGUMENT_RECOVERY
See Also:
Constant Field Values

scanner

public Scanner scanner

source

public char[] source

sourceParser

protected Parser sourceParser

checkDocComment

public boolean checkDocComment

setJavadocPositions

public boolean setJavadocPositions

reportProblems

public boolean reportProblems

complianceLevel

protected long complianceLevel

sourceLevel

protected long sourceLevel

inheritedPositions

protected long[] inheritedPositions

inheritedPositionsPtr

protected int inheritedPositionsPtr

deprecated

protected boolean deprecated

returnStatement

protected Object returnStatement

javadocStart

protected int javadocStart

javadocEnd

protected int javadocEnd

javadocTextStart

protected int javadocTextStart

javadocTextEnd

protected int javadocTextEnd

firstTagPosition

protected int firstTagPosition

index

protected int index

lineEnd

protected int lineEnd

tokenPreviousPosition

protected int tokenPreviousPosition

lastIdentifierEndPosition

protected int lastIdentifierEndPosition

starPosition

protected int starPosition

textStart

protected int textStart

memberStart

protected int memberStart

tagSourceStart

protected int tagSourceStart

tagSourceEnd

protected int tagSourceEnd

inlineTagStart

protected int inlineTagStart

lineEnds

protected int[] lineEnds

lineStarted

protected boolean lineStarted

inlineTagStarted

protected boolean inlineTagStarted

abort

protected boolean abort

kind

protected int kind

tagValue

protected int tagValue

lastBlockTagValue

protected int lastBlockTagValue

identifierPtr

protected int identifierPtr

identifierStack

protected char[][] identifierStack

identifierLengthPtr

protected int identifierLengthPtr

identifierLengthStack

protected int[] identifierLengthStack

identifierPositionStack

protected long[] identifierPositionStack

AST_STACK_INCREMENT

protected static final int AST_STACK_INCREMENT
See Also:
Constant Field Values

astPtr

protected int astPtr

astStack

protected Object[] astStack

astLengthPtr

protected int astLengthPtr

astLengthStack

protected int[] astLengthStack
Constructor Detail

AbstractCommentParser

protected AbstractCommentParser(Parser sourceParser)
Method Detail

commentParse

protected boolean commentParse()

consumeToken

protected void consumeToken()

createArgumentReference

protected abstract Object createArgumentReference(char[] name,
                                                  int dim,
                                                  boolean isVarargs,
                                                  Object typeRef,
                                                  long[] dimPos,
                                                  long argNamePos)
                                           throws InvalidInputException
Throws:
InvalidInputException

createFakeReference

protected boolean createFakeReference(int start)

createFieldReference

protected abstract Object createFieldReference(Object receiver)
                                        throws InvalidInputException
Throws:
InvalidInputException

createMethodReference

protected abstract Object createMethodReference(Object receiver,
                                                List arguments)
                                         throws InvalidInputException
Throws:
InvalidInputException

createReturnStatement

protected Object createReturnStatement()

createTag

protected abstract void createTag()

createTypeReference

protected abstract Object createTypeReference(int primitiveToken)

getCurrentTokenType

protected int getCurrentTokenType()
Returns:
Returns the currentTokenType.

parseArguments

protected Object parseArguments(Object receiver)
                         throws InvalidInputException
Throws:
InvalidInputException

parseHtmlTag

protected boolean parseHtmlTag(int previousPosition,
                               int endTextPosition)
                        throws InvalidInputException
Parse a possible HTML tag like: Note that the default is to do nothing!

Parameters:
previousPosition - The position of the '<' character on which the tag might start
endTextPosition - The position of the end of the previous text
Returns:
true if a valid html tag has been parsed, false otherwise
Throws:
InvalidInputException - If any problem happens during the parse in this area

parseHref

protected boolean parseHref()
                     throws InvalidInputException
Throws:
InvalidInputException

parseIdentifierTag

protected boolean parseIdentifierTag(boolean report)

parseMember

protected Object parseMember(Object receiver)
                      throws InvalidInputException
Throws:
InvalidInputException

parseParam

protected boolean parseParam()
                      throws InvalidInputException
Throws:
InvalidInputException

parseQualifiedName

protected Object parseQualifiedName(boolean reset)
                             throws InvalidInputException
Throws:
InvalidInputException

parseReference

protected boolean parseReference()
                          throws InvalidInputException
Throws:
InvalidInputException

parseTag

protected abstract boolean parseTag(int previousPosition)
                             throws InvalidInputException
Throws:
InvalidInputException

parseThrows

protected boolean parseThrows()

peekChar

protected char peekChar()

pushIdentifier

protected void pushIdentifier(boolean newLength,
                              boolean isToken)

pushOnAstStack

protected void pushOnAstStack(Object node,
                              boolean newLength)

pushParamName

protected abstract boolean pushParamName(boolean isTypeParam)

pushSeeRef

protected abstract boolean pushSeeRef(Object statement)

pushText

protected void pushText(int start,
                        int end)

pushThrowName

protected abstract boolean pushThrowName(Object typeRef)

readChar

protected char readChar()

readToken

protected int readToken()
                 throws InvalidInputException
Throws:
InvalidInputException

readTokenAndConsume

protected int readTokenAndConsume()
                           throws InvalidInputException
Throws:
InvalidInputException

readTokenSafely

protected int readTokenSafely()

recordInheritedPosition

protected void recordInheritedPosition(long position)

refreshInlineTagPosition

protected void refreshInlineTagPosition(int previousPosition)

refreshReturnStatement

protected void refreshReturnStatement()

setInlineTagStarted

protected void setInlineTagStarted(boolean started)
Parameters:
started - the inlineTagStarted to set

syntaxRecoverQualifiedName

protected Object syntaxRecoverQualifiedName(int primitiveToken)
                                     throws InvalidInputException
Throws:
InvalidInputException

toString

public String toString()
Overrides:
toString in class Object

updateDocComment

protected abstract void updateDocComment()

updateLineEnd

protected void updateLineEnd()

verifyEndLine

protected boolean verifyEndLine(int textPosition)

verifySpaceOrEndComment

protected boolean verifySpaceOrEndComment()


Copyright © 2012. All Rights Reserved.