org.apache.directory.shared.ldap.name
Class AntlrDnParser

java.lang.Object
  extended by antlr.Parser
      extended by antlr.LLkParser
          extended by org.apache.directory.shared.ldap.name.AntlrDnParser
All Implemented Interfaces:
AntlrDnTokenTypes

public class AntlrDnParser
extends antlr.LLkParser
implements AntlrDnTokenTypes

An antlr generated DN parser.

Version:
$Rev$
Author:
Apache Directory Project

Field Summary
static java.lang.String[] _tokenNames
           
static antlr.collections.impl.BitSet _tokenSet_0
           
 
Fields inherited from class antlr.Parser
astFactory, inputState, returnAST, tokenNames, tokenTypeToASTClassMap, traceDepth
 
Fields inherited from interface org.apache.directory.shared.ldap.name.AntlrDnTokenTypes
ALPHA, COMMA, DIGIT, DOT, DQUOTE, EOF, EQUALS, ESC, ESCESC, HEX, HEXPAIR, HEXPAIR_OR_ESCESC_OR_ESC, HEXVALUE, HEXVALUE_OR_SHARP, HYPHEN, LANGLE, LDIGIT, LUTF1_REST, NULL_TREE_LOOKAHEAD, NUMBER, NUMERICOID, NUMERICOID_OR_ALPHA_OR_DIGIT, PLUS, RANGLE, SEMI, SHARP, SPACE, UTFMB
 
Constructor Summary
  AntlrDnParser(antlr.ParserSharedInputState state)
           
  AntlrDnParser(antlr.TokenBuffer tokenBuf)
           
protected AntlrDnParser(antlr.TokenBuffer tokenBuf, int k)
           
  AntlrDnParser(antlr.TokenStream lexer)
           
protected AntlrDnParser(antlr.TokenStream lexer, int k)
           
 
Method Summary
 java.lang.String attributeType()
          RFC 4514 Section 3 attributeType = descr / numericoid
 java.lang.String attributeTypeAndValue(Rdn rdn)
          RFC 4514, Section 3 attributeTypeAndValue = attributeType EQUALS attributeValue RFC 2253, Section 3 attributeTypeAndValue = attributeType "=" attributeValue
 void attributeValue(org.apache.directory.shared.ldap.name.AntlrDnParser.UpAndNormValue value)
          RFC 4514, Section 3 attributeValue = string / hexstring RFC 2253, Section 3 attributeValue = string string = *( stringchar / pair ) / "#" hexstring / QUOTATION *( quotechar / pair ) QUOTATION ; only from v2
 java.lang.String descr()
          RFC 4512 Section 1.4 descr = keystring keystring = leadkeychar *keychar leadkeychar = ALPHA keychar = ALPHA / DIGIT / HYPHEN
 void distinguishedName(LdapDN dn)
          Parses an DN string.
 void hexstring(org.apache.directory.shared.ldap.name.AntlrDnParser.UpAndNormValue value)
          RFC 4514 Section 3 hexstring = SHARP 1*hexpair If in form, a BER representation can be obtained from converting each of the to the octet indicated by the .
 java.lang.String lutf1()
          RFC 4514, Section 3: LUTF1 = %x01-1F / %x21 / %x24-2A / %x2D-3A / %x3D / %x3F-5B / %x5D-7F The rule LUTF1_REST doesn't contain the following charcters, so we must check them additionally EQUALS (0x3D) -* HYPHEN (0x2D) DIGIT (0x30-0x39) ALPHA (0x41-0x5A and 0x61-0x7A)
 java.lang.String numericoid()
          RFC 4512 Section 1.4 numericoid = number 1*( DOT number ) number = DIGIT / ( LDIGIT 1*DIGIT ) DIGIT = %x30 / LDIGIT ; "0"-"9" LDIGIT = %x31-39 ; "1"-"9"
 byte[] pair(org.apache.directory.shared.ldap.name.AntlrDnParser.UpAndNormValue value)
          RFC 4514, Section 3 pair = ESC ( ESC / special / hexpair ) special = escaped / SPACE / SHARP / EQUALS escaped = DQUOTE / PLUS / COMMA / SEMI / LANGLE / RANGLE hexpair = HEX HEX If in form, a LDAP string representation asserted value can be obtained by replacing (left to right, non-recursively) each appearing in the as follows: replace with ; replace with ; replace with the octet indicated by the .
 void quotestring(org.apache.directory.shared.ldap.name.AntlrDnParser.UpAndNormValue value)
          RFC 2253, Section 3 / QUOTATION *( quotechar / pair ) QUOTATION ; only from v2 quotechar =
 Rdn relativeDistinguishedName(Rdn initialRdn)
          Parses an RDN string.
 void relativeDistinguishedNames(java.util.List<Rdn> rdns)
          Parses an DN string.
 void setParserMonitor(ParserMonitor monitor)
           
 java.lang.String special()
          RFC 4514 Section 3 special = escaped / SPACE / SHARP / EQUALS escaped = DQUOTE / PLUS / COMMA / SEMI / LANGLE / RANGLE TODO: For space an ESC is manually added.
 void string(org.apache.directory.shared.ldap.name.AntlrDnParser.UpAndNormValue value)
          RFC 4514 Section 3 ; The following characters are to be escaped when they appear ; in the value to be encoded: ESC, one of , leading ; SHARP or SPACE, trailing SPACE, and NULL.
 java.lang.String sutf1()
          RFC 4514, Section 3: SUTF1 = %x01-21 / %x23-2A / %x2D-3A / %x3D / %x3F-5B / %x5D-7F The rule LUTF1_REST doesn't contain the following charcters, so we must check them additionally EQUALS (0x3D) -* HYPHEN (0x2D) DIGIT (0x30-0x39) ALPHA (0x41-0x5A and 0x61-0x7A) SHARP SPACE
 java.lang.String utfmb()
           
 
Methods inherited from class antlr.LLkParser
consume, LA, LT, traceIn, traceOut
 
Methods inherited from class antlr.Parser
addMessageListener, addParserListener, addParserMatchListener, addParserTokenListener, addSemanticPredicateListener, addSyntacticPredicateListener, addTraceListener, consumeUntil, consumeUntil, defaultDebuggingSetup, getAST, getASTFactory, getFilename, getInputState, getTokenName, getTokenNames, getTokenTypeToASTClassMap, isDebugMode, mark, match, match, matchNot, panic, recover, removeMessageListener, removeParserListener, removeParserMatchListener, removeParserTokenListener, removeSemanticPredicateListener, removeSyntacticPredicateListener, removeTraceListener, reportError, reportError, reportWarning, rewind, setASTFactory, setASTNodeClass, setASTNodeType, setDebugMode, setFilename, setIgnoreInvalidDebugCalls, setInputState, setTokenBuffer, traceIndent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_tokenNames

public static final java.lang.String[] _tokenNames

_tokenSet_0

public static final antlr.collections.impl.BitSet _tokenSet_0
Constructor Detail

AntlrDnParser

protected AntlrDnParser(antlr.TokenBuffer tokenBuf,
                        int k)

AntlrDnParser

public AntlrDnParser(antlr.TokenBuffer tokenBuf)

AntlrDnParser

protected AntlrDnParser(antlr.TokenStream lexer,
                        int k)

AntlrDnParser

public AntlrDnParser(antlr.TokenStream lexer)

AntlrDnParser

public AntlrDnParser(antlr.ParserSharedInputState state)
Method Detail

setParserMonitor

public void setParserMonitor(ParserMonitor monitor)

distinguishedName

public final void distinguishedName(LdapDN dn)
                             throws antlr.RecognitionException,
                                    antlr.TokenStreamException
Parses an DN string. RFC 4514, Section 3 distinguishedName = [ relativeDistinguishedName *( COMMA relativeDistinguishedName ) ] RFC 2253, Section 3 distinguishedName = [name] name = name-component *("," name-component) RFC 1779, Section 2.3 ::= ( ) | ::= ::= "," | ";" ::= ( ) *( " " )

Throws:
antlr.RecognitionException
antlr.TokenStreamException

relativeDistinguishedName

public final Rdn relativeDistinguishedName(Rdn initialRdn)
                                    throws antlr.RecognitionException,
                                           antlr.TokenStreamException
Parses an RDN string. RFC 4514, Section 3 relativeDistinguishedName = attributeTypeAndValue *( PLUS attributeTypeAndValue ) RFC 2253, Section 3 name-component = attributeTypeAndValue *("+" attributeTypeAndValue) RFC 1779, Section 2.3 ::= | "+"

Throws:
antlr.RecognitionException
antlr.TokenStreamException

relativeDistinguishedNames

public final void relativeDistinguishedNames(java.util.List<Rdn> rdns)
                                      throws antlr.RecognitionException,
                                             antlr.TokenStreamException
Parses an DN string. RFC 4514, Section 3 distinguishedName = [ relativeDistinguishedName *( COMMA relativeDistinguishedName ) ] RFC 2253, Section 3 distinguishedName = [name] name = name-component *("," name-component) RFC 1779, Section 2.3 ::= ( ) | ::= ::= "," | ";" ::= ( ) *( " " )

Throws:
antlr.RecognitionException
antlr.TokenStreamException

attributeTypeAndValue

public final java.lang.String attributeTypeAndValue(Rdn rdn)
                                             throws antlr.RecognitionException,
                                                    antlr.TokenStreamException
RFC 4514, Section 3 attributeTypeAndValue = attributeType EQUALS attributeValue RFC 2253, Section 3 attributeTypeAndValue = attributeType "=" attributeValue

Throws:
antlr.RecognitionException
antlr.TokenStreamException

attributeType

public final java.lang.String attributeType()
                                     throws antlr.RecognitionException,
                                            antlr.TokenStreamException
RFC 4514 Section 3 attributeType = descr / numericoid

Throws:
antlr.RecognitionException
antlr.TokenStreamException

attributeValue

public final void attributeValue(org.apache.directory.shared.ldap.name.AntlrDnParser.UpAndNormValue value)
                          throws antlr.RecognitionException,
                                 antlr.TokenStreamException
RFC 4514, Section 3 attributeValue = string / hexstring RFC 2253, Section 3 attributeValue = string string = *( stringchar / pair ) / "#" hexstring / QUOTATION *( quotechar / pair ) QUOTATION ; only from v2

Throws:
antlr.RecognitionException
antlr.TokenStreamException

descr

public final java.lang.String descr()
                             throws antlr.RecognitionException,
                                    antlr.TokenStreamException
RFC 4512 Section 1.4 descr = keystring keystring = leadkeychar *keychar leadkeychar = ALPHA keychar = ALPHA / DIGIT / HYPHEN

Throws:
antlr.RecognitionException
antlr.TokenStreamException

numericoid

public final java.lang.String numericoid()
                                  throws antlr.RecognitionException,
                                         antlr.TokenStreamException
RFC 4512 Section 1.4 numericoid = number 1*( DOT number ) number = DIGIT / ( LDIGIT 1*DIGIT ) DIGIT = %x30 / LDIGIT ; "0"-"9" LDIGIT = %x31-39 ; "1"-"9"

Throws:
antlr.RecognitionException
antlr.TokenStreamException

quotestring

public final void quotestring(org.apache.directory.shared.ldap.name.AntlrDnParser.UpAndNormValue value)
                       throws antlr.RecognitionException,
                              antlr.TokenStreamException
RFC 2253, Section 3 / QUOTATION *( quotechar / pair ) QUOTATION ; only from v2 quotechar =

Throws:
antlr.RecognitionException
antlr.TokenStreamException

string

public final void string(org.apache.directory.shared.ldap.name.AntlrDnParser.UpAndNormValue value)
                  throws antlr.RecognitionException,
                         antlr.TokenStreamException
RFC 4514 Section 3 ; The following characters are to be escaped when they appear ; in the value to be encoded: ESC, one of , leading ; SHARP or SPACE, trailing SPACE, and NULL. string = [ ( leadchar / pair ) [ *( stringchar / pair ) ( trailchar / pair ) ] ] TODO: Trailing SPACE is manually removed. This needs review! TODO: ESC SPACE is replaced by a simgle SPACE. This needs review!

Throws:
antlr.RecognitionException
antlr.TokenStreamException

hexstring

public final void hexstring(org.apache.directory.shared.ldap.name.AntlrDnParser.UpAndNormValue value)
                     throws antlr.RecognitionException,
                            antlr.TokenStreamException
RFC 4514 Section 3 hexstring = SHARP 1*hexpair If in form, a BER representation can be obtained from converting each of the to the octet indicated by the .

Throws:
antlr.RecognitionException
antlr.TokenStreamException

pair

public final byte[] pair(org.apache.directory.shared.ldap.name.AntlrDnParser.UpAndNormValue value)
                  throws antlr.RecognitionException,
                         antlr.TokenStreamException
RFC 4514, Section 3 pair = ESC ( ESC / special / hexpair ) special = escaped / SPACE / SHARP / EQUALS escaped = DQUOTE / PLUS / COMMA / SEMI / LANGLE / RANGLE hexpair = HEX HEX If in form, a LDAP string representation asserted value can be obtained by replacing (left to right, non-recursively) each appearing in the as follows: replace with ; replace with ; replace with the octet indicated by the . RFC 2253, Section 3 pair = "\" ( special / "\" / QUOTATION / hexpair ) special = "," / "=" / "+" / "<" / ">" / "#" / ";" RFC 1779, Section 2.3 ::= "\" ( | "\" | '"') ::= "," | "=" | | "+" | "<" | ">" | "#" | ";" TODO: The ESC is removed from the norm value. This needs review!

Throws:
antlr.RecognitionException
antlr.TokenStreamException

lutf1

public final java.lang.String lutf1()
                             throws antlr.RecognitionException,
                                    antlr.TokenStreamException
RFC 4514, Section 3: LUTF1 = %x01-1F / %x21 / %x24-2A / %x2D-3A / %x3D / %x3F-5B / %x5D-7F The rule LUTF1_REST doesn't contain the following charcters, so we must check them additionally EQUALS (0x3D) -* HYPHEN (0x2D) DIGIT (0x30-0x39) ALPHA (0x41-0x5A and 0x61-0x7A)

Throws:
antlr.RecognitionException
antlr.TokenStreamException

utfmb

public final java.lang.String utfmb()
                             throws antlr.RecognitionException,
                                    antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.TokenStreamException

sutf1

public final java.lang.String sutf1()
                             throws antlr.RecognitionException,
                                    antlr.TokenStreamException
RFC 4514, Section 3: SUTF1 = %x01-21 / %x23-2A / %x2D-3A / %x3D / %x3F-5B / %x5D-7F The rule LUTF1_REST doesn't contain the following charcters, so we must check them additionally EQUALS (0x3D) -* HYPHEN (0x2D) DIGIT (0x30-0x39) ALPHA (0x41-0x5A and 0x61-0x7A) SHARP SPACE

Throws:
antlr.RecognitionException
antlr.TokenStreamException

special

public final java.lang.String special()
                               throws antlr.RecognitionException,
                                      antlr.TokenStreamException
RFC 4514 Section 3 special = escaped / SPACE / SHARP / EQUALS escaped = DQUOTE / PLUS / COMMA / SEMI / LANGLE / RANGLE TODO: For space an ESC is manually added. This needs review!

Throws:
antlr.RecognitionException
antlr.TokenStreamException


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.