Extends the inline parser dictionary.

@param
@return
12986
public function addInlineType($Marker, $Type)
    {
        if (!isset($this->InlineTypes[$Marker]))
        {
            $this->InlineTypes[$Marker] = [];
            $this->inlineMarkerList .= $Marker;
        }

        $InlineTypes = &$this->InlineTypes[$Marker];
        array_unshift($InlineTypes, $Type);

        return $this;
    }
1136525
public OperatorTable<T> infixr(
      Parser<? extends BiFunction<? super T, ? super T, ? extends T>> parser, int precedence) {
    ops.add(new Operator(parser, precedence, Associativity.RASSOC));
    return this;
  }
439629
private static Map<String, String> dictionaryToMap( final Dictionary dictionary )
    {
        final Map<String, String> map = new HashMap<String, String>();
        try
        {
            // first try a shortcut
            if( dictionary instanceof Hashtable )
            {
                map.putAll( (Hashtable<String, String>) dictionary );
            }
            else
            {
                final Enumeration keys = dictionary.keys();
                while( keys.hasMoreElements() )
                {
                    final String key = (String) keys.nextElement();
                    map.put( key, (String) dictionary.get( key ) );
                }
            }
            return map;
        }
        catch( ClassCastException e )
        {
            throw new IllegalArgumentException( "Dictionary entries must have String keys and values" );
        }
    }
482029
def add_parser_from_field(self, name, field_cls):
        """"""
        self.__parser_map__[name] = _field2method(field_cls, method_name=name)
306002
private void addDefaultParsers() {
		parsers = new ArrayList<IParser>();
		parsers.add(new GeldKarteParser(this));
		parsers.add(new EmvParser(this));
	}
950667
public static <T extends Dict> T fill(T dict){
		dict.putAll(getParamMap());
		return dict;
	}
956372
function parseRawLines(rawText, extendedSyntax, parsedRawLinesCallback) {
        var entries = rawText.replace(reBlank, '').split(/[\r\n]+/);
        var currentLang = '*';
        var genericLang = lang.split('-', 1)[0];
        var skipLang = false;
        var match = '';

        function nextEntry() {
          // Use infinite loop instead of recursion to avoid reaching the
          // maximum recursion limit for content with many lines.
          while (true) {
            if (!entries.length) {
              parsedRawLinesCallback();
              return;
            }
            var line = entries.shift();

            // comment or blank line?
            if (reComment.test(line))
              continue;

            // the extended syntax supports [lang] sections and @import rules
            if (extendedSyntax) {
              match = reSection.exec(line);
              if (match) { // section start?
                // RFC 4646, section 4.4, "All comparisons MUST be performed
                // in a case-insensitive manner."

                currentLang = match[1].toLowerCase();
                skipLang = (currentLang !== '*') &&
                    (currentLang !== lang) && (currentLang !== genericLang);
                continue;
              } else if (skipLang) {
                continue;
              }
              match = reImport.exec(line);
              if (match) { // @import rule?
                loadImport(baseURL + match[1], nextEntry);
                return;
              }
            }

            // key-value pair
            var tmp = line.match(reSplit);
            if (tmp && tmp.length == 3) {
              dictionary[tmp[1]] = evalString(tmp[2]);
            }
          }
        }
        nextEntry();
      }
1086632
public final ProtoParser.extend_block_return extend_block(Proto proto, Message parent) throws RecognitionException {
        ProtoParser.extend_block_return retval = new ProtoParser.extend_block_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token EXTEND157=null;
        Token FULL_ID158=null;
        Token ID159=null;
        Token LEFTCURLY160=null;
        Token RIGHTCURLY162=null;
        Token SEMICOLON163=null;
        ProtoParser.extend_body_return extend_body161 = null;


        Object EXTEND157_tree=null;
        Object FULL_ID158_tree=null;
        Object ID159_tree=null;
        Object LEFTCURLY160_tree=null;
        Object RIGHTCURLY162_tree=null;
        Object SEMICOLON163_tree=null;


            Extension extension = null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:614:5: ( EXTEND ( FULL_ID | ID ) LEFTCURLY ( extend_body[proto, extension] )* RIGHTCURLY ( ( SEMICOLON )? ) )
            // com/dyuproject/protostuff/parser/ProtoParser.g:614:9: EXTEND ( FULL_ID | ID ) LEFTCURLY ( extend_body[proto, extension] )* RIGHTCURLY ( ( SEMICOLON )? )
            {
            root_0 = (Object)adaptor.nil();

            EXTEND157=(Token)match(input,EXTEND,FOLLOW_EXTEND_in_extend_block2513); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            EXTEND157_tree = (Object)adaptor.create(EXTEND157);
            adaptor.addChild(root_0, EXTEND157_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:614:16: ( FULL_ID | ID )
            int alt34=2;
            switch ( input.LA(1) ) {
            case FULL_ID:
                {
                alt34=1;
                }
                break;
            case ID:
                {
                alt34=2;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 34, 0, input);

                throw nvae;
            }

            switch (alt34) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:615:9: FULL_ID
                    {
                    FULL_ID158=(Token)match(input,FULL_ID,FOLLOW_FULL_ID_in_extend_block2525); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    FULL_ID158_tree = (Object)adaptor.create(FULL_ID158);
                    adaptor.addChild(root_0, FULL_ID158_tree);
                    }
                    if ( state.backtracking==0 ) {

                                  String fullType = (FULL_ID158!=null?FULL_ID158.getText():null);
                                  int lastDot = fullType.lastIndexOf('.');
                                  String packageName = fullType.substring(0, lastDot); 
                                  String type = fullType.substring(lastDot+1);
                                  extension = new Extension(proto, parent, packageName, type);
                              
                    }

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:621:13: ID
                    {
                    ID159=(Token)match(input,ID,FOLLOW_ID_in_extend_block2531); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    ID159_tree = (Object)adaptor.create(ID159);
                    adaptor.addChild(root_0, ID159_tree);
                    }
                    if ( state.backtracking==0 ) {
                       extension = new Extension(proto, parent, null, (ID159!=null?ID159.getText():null)); 
                    }

                    }
                    break;

            }

            if ( state.backtracking==0 ) {

                          if(parent==null)
                              proto.addExtension(extension);
                          else
                              parent.addNestedExtension(extension);
                              
                          proto.addAnnotationsTo(extension);
                      
            }
            LEFTCURLY160=(Token)match(input,LEFTCURLY,FOLLOW_LEFTCURLY_in_extend_block2547); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            LEFTCURLY160_tree = (Object)adaptor.create(LEFTCURLY160);
            adaptor.addChild(root_0, LEFTCURLY160_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:629:19: ( extend_body[proto, extension] )*
            loop35:
            do {
                int alt35=2;
                switch ( input.LA(1) ) {
                case AT:
                case REQUIRED:
                case OPTIONAL:
                case REPEATED:
                    {
                    alt35=1;
                    }
                    break;

                }

                switch (alt35) {
            	case 1 :
            	    // com/dyuproject/protostuff/parser/ProtoParser.g:629:20: extend_body[proto, extension]
            	    {
            	    pushFollow(FOLLOW_extend_body_in_extend_block2550);
            	    extend_body161=extend_body(proto, extension);

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) adaptor.addChild(root_0, extend_body161.getTree());

            	    }
            	    break;

            	default :
            	    break loop35;
                }
            } while (true);

            RIGHTCURLY162=(Token)match(input,RIGHTCURLY,FOLLOW_RIGHTCURLY_in_extend_block2555); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            RIGHTCURLY162_tree = (Object)adaptor.create(RIGHTCURLY162);
            adaptor.addChild(root_0, RIGHTCURLY162_tree);
            }
            if ( state.backtracking==0 ) {

                          if(!proto.annotations.isEmpty())
                              throw new IllegalStateException("Misplaced annotations: " + proto.annotations);
                              
                      
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:633:11: ( ( SEMICOLON )? )
            // com/dyuproject/protostuff/parser/ProtoParser.g:633:12: ( SEMICOLON )?
            {
            // com/dyuproject/protostuff/parser/ProtoParser.g:633:12: ( SEMICOLON )?
            int alt36=2;
            switch ( input.LA(1) ) {
                case SEMICOLON:
                    {
                    alt36=1;
                    }
                    break;
            }

            switch (alt36) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:633:12: SEMICOLON
                    {
                    SEMICOLON163=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_extend_block2560); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    SEMICOLON163_tree = (Object)adaptor.create(SEMICOLON163);
                    adaptor.addChild(root_0, SEMICOLON163_tree);
                    }

                    }
                    break;

            }


            }


            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
1152196
public final void parse() {
        Collection<Keyword> unsupportedRestKeywords = new LinkedList<>();
        unsupportedRestKeywords.addAll(Arrays.asList(DefaultKeyword.UNION, DefaultKeyword.INTERSECT, DefaultKeyword.EXCEPT, DefaultKeyword.MINUS));
        unsupportedRestKeywords.addAll(Arrays.asList(getUnsupportedKeywordsRest()));
        lexerEngine.unsupportedIfEqual(unsupportedRestKeywords.toArray(new Keyword[unsupportedRestKeywords.size()]));
    }
663020
public static <K, V> Map<K, V> wrap(Dictionary<K, V> dictionary) {
        if (dictionary instanceof MapAsDictionary) {
            return ((MapAsDictionary<K, V>) dictionary).getMap();
        }
        return new DictionaryAsMap<K, V>(dictionary);
    }
1328399
@Override
    public void initializeParsers(ExtensionParsingContext context) {
        for (JGroupsSchema schema : JGroupsSchema.SCHEMAS) {
            context.setSubsystemXmlMapping(SUBSYSTEM_NAME, schema.getNamespaceUri(), new JGroupsSubsystemXMLReader(schema));
        }
    }
610054
private static boolean parseElementInternal(
      XmlPullParser parser,
      ArrayList<Type> context,
      Object destination,
      Type valueType,
      XmlNamespaceDictionary namespaceDictionary,
      CustomizeParser customizeParser)
      throws IOException, XmlPullParserException {
    // TODO(yanivi): method is too long; needs to be broken down into smaller methods and comment
    // better
    GenericXml genericXml = destination instanceof GenericXml ? (GenericXml) destination : null;
    @SuppressWarnings("unchecked")
    Map<String, Object> destinationMap =
        genericXml == null && destination instanceof Map<?, ?> ? Map.class.cast(destination) : null;

    // if there is a class, we want to put the data into, create the class Info for this
    ClassInfo classInfo =
        destinationMap != null || destination == null ? null : ClassInfo.of(destination.getClass());
    if (parser.getEventType() == XmlPullParser.START_DOCUMENT) {
      parser.next();
    }
    parseNamespacesForElement(parser, namespaceDictionary);
    // generic XML
    if (genericXml != null) {
      genericXml.namespaceDictionary = namespaceDictionary;
      String name = parser.getName();
      String namespace = parser.getNamespace();
      String alias = namespaceDictionary.getNamespaceAliasForUriErrorOnUnknown(namespace);
      genericXml.name = alias.length() == 0 ? name : alias + ":" + name;
    }
    // attributes
    if (destination != null) {
      int attributeCount = parser.getAttributeCount();
      for (int i = 0; i < attributeCount; i++) {
        // TODO(yanivi): can have repeating attribute values, e.g. "@a=value1 @a=value2"?
        String attributeName = parser.getAttributeName(i);
        String attributeNamespace = parser.getAttributeNamespace(i);
        String attributeAlias =
            attributeNamespace.length() == 0
                ? ""
                : namespaceDictionary.getNamespaceAliasForUriErrorOnUnknown(attributeNamespace);
        String fieldName = getFieldName(true, attributeAlias, attributeNamespace, attributeName);
        Field field = classInfo == null ? null : classInfo.getField(fieldName);
        parseAttributeOrTextContent(
            parser.getAttributeValue(i),
            field,
            valueType,
            context,
            destination,
            genericXml,
            destinationMap,
            fieldName);
      }
    }
    Field field;
    ArrayValueMap arrayValueMap = new ArrayValueMap(destination);
    boolean isStopped = false;
    // TODO(yanivi): support Void type as "ignore" element/attribute
    main:
    while (true) {
      int event = parser.next();
      switch (event) {
        case XmlPullParser.END_DOCUMENT:
          isStopped = true;
          break main;
        case XmlPullParser.END_TAG:
          isStopped =
              customizeParser != null
                  && customizeParser.stopAfterEndTag(parser.getNamespace(), parser.getName());
          break main;
        case XmlPullParser.TEXT:
          // parse text content
          if (destination != null) {
            field = classInfo == null ? null : classInfo.getField(TEXT_CONTENT);
            parseAttributeOrTextContent(
                parser.getText(),
                field,
                valueType,
                context,
                destination,
                genericXml,
                destinationMap,
                TEXT_CONTENT);
          }
          break;
        case XmlPullParser.START_TAG:
          if (customizeParser != null
              && customizeParser.stopBeforeStartTag(parser.getNamespace(), parser.getName())) {
            isStopped = true;
            break main;
          }
          if (destination == null) {
            parseTextContentForElement(parser, context, true, null);
          } else {
            // element
            parseNamespacesForElement(parser, namespaceDictionary);
            String namespace = parser.getNamespace();
            String alias = namespaceDictionary.getNamespaceAliasForUriErrorOnUnknown(namespace);

            //  get the "real" field name of the
            String fieldName = getFieldName(false, alias, namespace, parser.getName());

            // fetch the field from the classInfo
            field = classInfo == null ? null : classInfo.getField(fieldName);
            Type fieldType = field == null ? valueType : field.getGenericType();
            fieldType = Data.resolveWildcardTypeOrTypeVariable(context, fieldType);
            // field type is now class, parameterized type, or generic array type
            // resolve a parameterized type to a class
            Class<?> fieldClass = fieldType instanceof Class<?> ? (Class<?>) fieldType : null;
            if (fieldType instanceof ParameterizedType) {
              fieldClass = Types.getRawClass((ParameterizedType) fieldType);
            }
            boolean isArray = Types.isArray(fieldType);
            // text content
            boolean ignore = field == null && destinationMap == null && genericXml == null;
            // is the field an Enum
            boolean isEnum = fieldClass != null && fieldClass.isEnum();
            if (ignore || Data.isPrimitive(fieldType) || isEnum) {
              int level = 1;
              while (level != 0) {
                switch (parser.next()) {
                  case XmlPullParser.END_DOCUMENT:
                    isStopped = true;
                    break main;
                  case XmlPullParser.START_TAG:
                    level++;
                    break;
                  case XmlPullParser.END_TAG:
                    level--;
                    break;
                  case XmlPullParser.TEXT:
                    if (!ignore && level == 1) {
                      parseAttributeOrTextContent(
                          parser.getText(),
                          field,
                          valueType,
                          context,
                          destination,
                          genericXml,
                          destinationMap,
                          fieldName);
                    }
                    break;
                  default:
                    break;
                }
              }
            } else if (fieldType == null
                || fieldClass != null && Types.isAssignableToOrFrom(fieldClass, Map.class)) {
              // store the element as a map
              Map<String, Object> mapValue = Data.newMapInstance(fieldClass);
              int contextSize = context.size();
              if (fieldType != null) {
                context.add(fieldType);
              }
              Type subValueType =
                  fieldType != null && Map.class.isAssignableFrom(fieldClass)
                      ? Types.getMapValueParameter(fieldType)
                      : null;
              subValueType = Data.resolveWildcardTypeOrTypeVariable(context, subValueType);
              isStopped =
                  parseElementInternal(
                      parser,
                      context,
                      mapValue,
                      subValueType,
                      namespaceDictionary,
                      customizeParser);
              if (fieldType != null) {
                context.remove(contextSize);
              }
              if (destinationMap != null) {
                // map but not GenericXml: store as ArrayList of elements
                @SuppressWarnings("unchecked")
                Collection<Object> list = (Collection<Object>) destinationMap.get(fieldName);
                if (list == null) {
                  list = new ArrayList<Object>(1);
                  destinationMap.put(fieldName, list);
                }
                list.add(mapValue);
              } else if (field != null) {
                // not a map: store in field value
                FieldInfo fieldInfo = FieldInfo.of(field);
                if (fieldClass == Object.class) {
                  // field is an Object: store as ArrayList of element maps
                  @SuppressWarnings("unchecked")
                  Collection<Object> list = (Collection<Object>) fieldInfo.getValue(destination);
                  if (list == null) {
                    list = new ArrayList<Object>(1);
                    fieldInfo.setValue(destination, list);
                  }
                  list.add(mapValue);
                } else {
                  // field is a Map: store as a single element map
                  fieldInfo.setValue(destination, mapValue);
                }
              } else {
                // GenericXml: store as ArrayList of elements
                GenericXml atom = (GenericXml) destination;
                @SuppressWarnings("unchecked")
                Collection<Object> list = (Collection<Object>) atom.get(fieldName);
                if (list == null) {
                  list = new ArrayList<Object>(1);
                  atom.set(fieldName, list);
                }
                list.add(mapValue);
              }
            } else if (isArray || Types.isAssignableToOrFrom(fieldClass, Collection.class)) {
              // TODO(yanivi): some duplicate code here; isolate into reusable methods
              FieldInfo fieldInfo = FieldInfo.of(field);
              Object elementValue = null;
              Type subFieldType =
                  isArray
                      ? Types.getArrayComponentType(fieldType)
                      : Types.getIterableParameter(fieldType);
              Class<?> rawArrayComponentType =
                  Types.getRawArrayComponentType(context, subFieldType);
              subFieldType = Data.resolveWildcardTypeOrTypeVariable(context, subFieldType);
              Class<?> subFieldClass =
                  subFieldType instanceof Class<?> ? (Class<?>) subFieldType : null;
              if (subFieldType instanceof ParameterizedType) {
                subFieldClass = Types.getRawClass((ParameterizedType) subFieldType);
              }
              boolean isSubEnum = subFieldClass != null && subFieldClass.isEnum();
              if (Data.isPrimitive(subFieldType) || isSubEnum) {
                elementValue = parseTextContentForElement(parser, context, false, subFieldType);
              } else if (subFieldType == null
                  || subFieldClass != null
                      && Types.isAssignableToOrFrom(subFieldClass, Map.class)) {
                elementValue = Data.newMapInstance(subFieldClass);
                int contextSize = context.size();
                if (subFieldType != null) {
                  context.add(subFieldType);
                }
                Type subValueType =
                    subFieldType != null && Map.class.isAssignableFrom(subFieldClass)
                        ? Types.getMapValueParameter(subFieldType)
                        : null;
                subValueType = Data.resolveWildcardTypeOrTypeVariable(context, subValueType);
                isStopped =
                    parseElementInternal(
                        parser,
                        context,
                        elementValue,
                        subValueType,
                        namespaceDictionary,
                        customizeParser);
                if (subFieldType != null) {
                  context.remove(contextSize);
                }
              } else {
                elementValue = Types.newInstance(rawArrayComponentType);
                int contextSize = context.size();
                context.add(fieldType);
                isStopped =
                    parseElementInternal(
                        parser, context, elementValue, null, namespaceDictionary, customizeParser);
                context.remove(contextSize);
              }
              if (isArray) {
                // array field: add new element to array value map
                if (field == null) {
                  arrayValueMap.put(fieldName, rawArrayComponentType, elementValue);
                } else {
                  arrayValueMap.put(field, rawArrayComponentType, elementValue);
                }
              } else {
                // collection: add new element to collection
                @SuppressWarnings("unchecked")
                Collection<Object> collectionValue =
                    (Collection<Object>)
                        (field == null
                            ? destinationMap.get(fieldName)
                            : fieldInfo.getValue(destination));
                if (collectionValue == null) {
                  collectionValue = Data.newCollectionInstance(fieldType);
                  setValue(
                      collectionValue, field, destination, genericXml, destinationMap, fieldName);
                }
                collectionValue.add(elementValue);
              }
            } else {
              // not an array/iterable or a map, but we do have a field
              Object value = Types.newInstance(fieldClass);
              int contextSize = context.size();
              context.add(fieldType);
              isStopped =
                  parseElementInternal(
                      parser, context, value, null, namespaceDictionary, customizeParser);
              context.remove(contextSize);
              setValue(value, field, destination, genericXml, destinationMap, fieldName);
            }
          }
          if (isStopped || parser.getEventType() == XmlPullParser.END_DOCUMENT) {
            isStopped = true;
            break main;
          }
          break; // break Switch;
      } // end -- switch (event)
    } // end -- main: while (true)
    arrayValueMap.setValues();
    return isStopped;
  }
1319751
private CFG inlineAll() throws CFGBuilderException {
        CFG result = new CFG();

        Context rootContext = new Context(null, topLevelSubroutine, result);
        rootContext.mapBlock(topLevelSubroutine.getEntry(), result.getEntry());
        rootContext.mapBlock(topLevelSubroutine.getExit(), result.getExit());

        BasicBlock resultStartBlock = rootContext.getBlock(topLevelSubroutine.getStartBlock());
        result.createEdge(result.getEntry(), resultStartBlock, START_EDGE);

        inline(rootContext);

        return result;
    }
611537
public LSParser createLSParser() {
        LSParser parser = domImpl.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null);
        configureParser(parser);

        return parser;
    }
354802
@SuppressWarnings({"unchecked", "rawtypes"})
  @Private static <T> Parser<T>[] toArray(Iterable<? extends Parser<? extends T>> parsers) {
    if (parsers instanceof Collection<?>) {
      return toArray((Collection) parsers);
    }
    return toArrayWithIteration(parsers);
  }
937905
static Parser<Token[]> tokens(final Parser<? extends Collection<Token>> parser) {
    return parser.map(list -> list.toArray(new Token[list.size()]));
  }
462687
private DCTree inlineText(WhitespaceRetentionPolicy whitespacePolicy) throws ParseException {
        switch (whitespacePolicy) {
            case REMOVE_ALL:
                skipWhitespace();
                break;
            case REMOVE_FIRST_SPACE:
                if (ch == ' ')
                    nextChar();
                break;
            case RETAIN_ALL:
            default:
                // do nothing
                break;

        }
        int pos = bp;
        int depth = 1;

        loop:
        while (bp < buflen) {
            switch (ch) {
                case '\n': case '\r': case '\f':
                    newline = true;
                    break;

                case ' ': case '\t':
                    break;

                case '{':
                    newline = false;
                    lastNonWhite = bp;
                    depth++;
                    break;

                case '}':
                    if (--depth == 0) {
                        return m.at(pos).newTextTree(newString(pos, bp));
                    }
                    newline = false;
                    lastNonWhite = bp;
                    break;

                case '@':
                    if (newline)
                        break loop;
                    newline = false;
                    lastNonWhite = bp;
                    break;

                default:
                    newline = false;
                    lastNonWhite = bp;
                    break;
            }
            nextChar();
        }
        throw new ParseException("dc.unterminated.inline.tag");
    }