Patent ID: 8806456
Filing Date: 2014-08-12
Classification: G06F

Abstract:
1. A system for configuration preserving parsing for a grammar of a language using a parser comprising one or more subparsers and one or more merged parsers, the system having a processor and memory comprising: a parser configured to: parse a plurality of tokens, wherein the plurality of tokens comprise language tokens and conditional tokens, wherein various configurations are possible based upon the conditional tokens, wherein the parser comprises a head and a stack, wherein the stack comprises previously parsed tokens, and wherein the head comprises a current token; create, for each conditional token in the plurality of tokens, a token follow-set consisting of each possible language token that can immediately follow the conditional token; determine, for each conditional token, whether to fork a subparser for the conditional token in each of the token follow-sets, wherein the subparser parses a portion of the plurality of tokens including a token from the token follow-set of the conditional token; fork one or more subparsers based upon determining whether to fork a subparser for the conditional token in each of the token follow-sets, wherein each of the one or more subparsers have the same parser stack and comprises one or more previously parsed tokens up to and including the conditional token used to fork the one or more subparsers, wherein each of the one or more subparsers includes a presence condition based on the conditional token and a head that are unique to other subparsers, wherein each subparser has a head that is a token from the token follow-set, and wherein each subparser represents a distinct configuration associated with the presence condition; merge two or more subparsers into a merged parser when the two or more subparsers have the same head and stack, wherein a presence condition for the merged parser is a disjunction of the presence conditions of the two or more subparsers, and wherein a head of the merged parser is the head of the two or more subparsers; and generate a syntax tree from the plurality of tokens that preserves all possible configurations based upon the subparsers and the merged parser.