Parser
public class Parser
www.doctrine-project.org
Constructor Summary | |
---|---|
Parser() Constructs a new AnnotationParser. |
Method Summary | |
---|---|
mixed | Annotation ::= "@" AnnotationName ["(" [Values] ")"] AnnotationName ::= QualifiedName | SimpleName | AliasedName QualifiedName ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName AliasedName ::= Alias ":" SimpleName NameSpacePart ::= identifier SimpleName ::= identifier Alias ::= identifier |
array | Annotations ::= Annotation {[ "*" ]* [Annotation]} |
array | ArrayEntry ::= Value | KeyValuePair KeyValuePair ::= Key "=" PlainValue Key ::= string | integer |
array | Arrayx() Array ::= "{" ArrayEntry {"," ArrayEntry}* "}" |
array | FieldAssignment ::= FieldName "=" PlainValue FieldName ::= identifier |
mixed | PlainValue ::= integer | string | float | boolean | Array | Annotation |
mixed | Value() Value ::= PlainValue | FieldAssignment |
array | Values() Values ::= Array | Value {"," Value} |
bool | match(int|string token) Attempts to match the given token with the current lookahead token. |
array | parse(string docBlockString, string context) Parses the given docblock string for annotations. |
void | setAnnotationNamespaceAlias(mixed namespace, mixed alias, $alias ) Sets an alias for an annotation namespace. |
void | setDefaultAnnotationNamespace(mixed defaultNamespace, $defaultNamespace ) Sets the default namespace that is assumed for an annotation that does not define a namespace prefix. |
public Parser()
Constructs a new AnnotationParser.
public mixed Annotation()
Annotation ::= "@" AnnotationName ["(" [Values] ")"] AnnotationName ::= QualifiedName | SimpleName | AliasedName QualifiedName ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName AliasedName ::= Alias ":" SimpleName NameSpacePart ::= identifier SimpleName ::= identifier Alias ::= identifier
public array Annotations()
Annotations ::= Annotation {[ "*" ]* [Annotation]}
public array ArrayEntry()
ArrayEntry ::= Value | KeyValuePair KeyValuePair ::= Key "=" PlainValue Key ::= string | integer
public array Arrayx()
Array ::= "{" ArrayEntry {"," ArrayEntry}* "}"
public array FieldAssignment()
FieldAssignment ::= FieldName "=" PlainValue FieldName ::= identifier
public mixed PlainValue()
PlainValue ::= integer | string | float | boolean | Array | Annotation
public mixed Value()
Value ::= PlainValue | FieldAssignment
public array Values()
Values ::= Array | Value {"," Value}
public bool match(int|string token)
Attempts to match the given token with the current lookahead token. If they match, updates the lookahead token; otherwise raises a syntax error.
public array parse(string docBlockString, string context)
Parses the given docblock string for annotations.
public void setAnnotationNamespaceAlias(mixed namespace, mixed alias, $alias )
Sets an alias for an annotation namespace.
public void setDefaultAnnotationNamespace(mixed defaultNamespace, $defaultNamespace )
Sets the default namespace that is assumed for an annotation that does not define a namespace prefix.
A simple parser for docblock annotations.