Global Information Lookup Global Information

Parsing expression grammar information


In computer science, a parsing expression grammar (PEG) is a type of analytic formal grammar, i.e. it describes a formal language in terms of a set of rules for recognizing strings in the language. The formalism was introduced by Bryan Ford in 2004[1] and is closely related to the family of top-down parsing languages introduced in the early 1970s. Syntactically, PEGs also look similar to context-free grammars (CFGs), but they have a different interpretation: the choice operator selects the first match in PEG, while it is ambiguous in CFG. This is closer to how string recognition tends to be done in practice, e.g. by a recursive descent parser.

Unlike CFGs, PEGs cannot be ambiguous; a string has exactly one valid parse tree or none. It is conjectured that there exist context-free languages that cannot be recognized by a PEG, but this is not yet proven.[1] PEGs are well-suited to parsing computer languages (and artificial human languages such as Lojban) where multiple interpretation alternatives can be disambiguated locally, but are less likely to be useful for parsing natural languages where disambiguation may have to be global.[2]

  1. ^ a b Ford, Bryan (January 2004). "Parsing Expression Grammars: A Recognition Based Syntactic Foundation" (PDF). Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM. pp. 111–122. doi:10.1145/964001.964011. ISBN 1-58113-729-X.
  2. ^ Ford, Bryan (September 2002). "Packrat parsing: simple, powerful, lazy, linear time, functional pearl" (PDF). ACM SIGPLAN Notices. 37 (9). doi:10.1145/583852.581483.

and 21 Related for: Parsing expression grammar information

Request time (Page generated in 0.8631 seconds.)

Parsing expression grammar

Last Update:

In computer science, a parsing expression grammar (PEG) is a type of analytic formal grammar, i.e. it describes a formal language in terms of a set of...

Word Count : 6426

Parsing

Last Update:

languages or data structures, conforming to the rules of a formal grammar. The term parsing comes from Latin pars (orationis), meaning part (of speech). The...

Word Count : 4857

Recursive descent parser

Last Update:

combinatory parsing, a method of factoring recursive descent parser designs Parsing expression grammar – another form representing recursive descent grammar Recursive...

Word Count : 1119

Comparison of parser generators

Last Update:

This table compares parser generators with parsing expression grammars, deterministic boolean grammars. This table compares parser generator languages...

Word Count : 1106

Formal grammar

Last Update:

examining the positional relationships between pairs of words. Parsing expression grammars (PEGs): a more recent generalization of TDPL designed around...

Word Count : 3431

Packrat parser

Last Update:

it takes parsing expression grammars (PEGs) as input rather than LL grammars. In 1970, Alexander Birman laid the groundwork for packrat parsing by introducing...

Word Count : 1860

Parser Grammar Engine

Last Update:

the Parrot virtual machine. PGE uses these rules to convert a parsing expression grammar into Parrot bytecode. It is therefore compiling rules into a program...

Word Count : 523

LL parser

Last Update:

LL parser is called an LL(k) parser if it uses k tokens of lookahead when parsing a sentence. A grammar is called an LL(k) grammar if an LL(k) parser can...

Word Count : 4363

Parse tree

Last Update:

A parse tree or parsing tree or derivation tree or concrete syntax tree is an ordered, rooted tree that represents the syntactic structure of a string...

Word Count : 1353

Raku rules

Last Update:

larger framework called rules, which provide the capabilities of a parsing expression grammar, as well as acting as a closure with respect to their lexical...

Word Count : 1330

LR parser

Last Update:

parser). LR parsers can handle a larger range of languages and grammars than precedence parsers or top-down LL parsing. This is because the LR parser...

Word Count : 8128

Dangling else

Last Update:

non-ambiguous context-free grammar. Alternatively, one may rely on a non-context-free grammar or a parsing expression grammar. The problem can also be solved...

Word Count : 1236

Regular expression

Last Update:

the definition of parsing expression grammars. The result is a mini-language called Raku rules, which are used to define Raku grammar as well as provide...

Word Count : 8915

OMeta

Last Update:

Research Institute. The language is based on parsing expression grammar (PEGs) rather than context-free grammar with the intent of providing "a natural and...

Word Count : 2306

Earley parser

Last Update:

nullable grammars. The algorithm, named after its inventor, Jay Earley, is a chart parser that uses dynamic programming; it is mainly used for parsing in computational...

Word Count : 1997

Ambiguous grammar

Last Update:

context-sensitive parsing rules, so the overall phrase grammar is unambiguous.[citation needed] Some parsing algorithms (such as Earley or GLR parsers) can generate...

Word Count : 1820

PackCC

Last Update:

source file. The grammar of an output parser can be described in a PEG (Parsing Expression Grammar). The PEG is a top-down parsing language, and is similar...

Word Count : 404

Attribute grammar

Last Update:

evaluation of arithmetic expressions, attribute grammar may be used to describe the entire task to be performed besides parsing in straightforward way;...

Word Count : 1183

Definite clause grammar

Last Update:

an article called "Parsing as Deduction", describing things such as how the Earley Deduction proof procedure is used for parsing. Pereira also collaborated...

Word Count : 1902

Memoization

Last Update:

Ford demonstrated that memoization could guarantee that parsing expression grammars could parse in linear time even those languages that resulted in worst-case...

Word Count : 3744

Rebol

Last Update:

dialect belongs to the family of grammars represented by the top-down parsing language or the parsing expression grammar (PEG). The main similarity is the...

Word Count : 2157

PDF Search Engine © AllGlobal.net