Parser

A parser is a computer program or a component of a program that analyses the grammatical structure of an input, with respect to a given formal grammar, a process known as parsing. Parsers can be made both for natural languages and for programming languages. Programming language parsers tend to be based around context free grammars as fast and efficient parsers can be written for them. For example LALR parsers are capable of efficiently analysing a wide class of context free grammars.

The task of the parser can be summarized as to determine if and how the input can be derived from the start symbol with the rules of the grammar. A parser can do this in essentially two ways: it can start with the input and attempt to rewrite it to the start symbol, a so-called bottom-up parser, or it can start with the start symbol and try to rewrite it to the input, a so-called top-down parser. For example LL parsers are top-down parsers and LR parsers are bottom-up parsers.

Another important distinction is whether the parser generates a leftmost derivation or a rightmost derivation (see context-free grammar). LL parsers will generate a leftmost derivation and LR parsers will generate a rightmost derivation (although usually in reverse).

A parser generator is a program which takes a formal description of a grammar (e.g. in BNF) and outputs source code for a parser. This parser will then recognise valid strings obeying that grammar and perform associated actions. Unix's yacc is a well known example. Among others are SableCC.

Table of contents
1 Overview of Parsers
2 See also

Overview of Parsers

Top-down parsers

As the name suggests, a Top-down parser works in principle by constructing an abstract syntax tree from the Top node on Down, usually in a pre-order tree traversal pattern. The syntax tree is derived according to the rules of the grammar and the current input token. See the links below for common types of Top-down parsers.

Bottom-up parsers

See also


This article (or an earlier version of it) contains material from FOLDOC, used with permission.


In the News

[Funny] A referee has sent himself off in an English amateur league ma
Andy Wain had to abandon the Sunday league match between Peterborough North End and a Royal Mail side in the 63rd minute after throwing down his whistle and marching up to confront North End's keeper.

Huge Numbers Want Cosmetic Surgery, Study Finds
Most women, and large numbers of men, expressed interest in having cosmetic surgery, university scientists report. Forty-eight percent of women surveyed said they would be interested in cosmetic surgery, liposuction or both, and another 23 percent said they would possibly be interested. Among men, 23 percent said they would be interested in surgery, with 17 percent expressing possible interest.

Difference Between Fish And Humans: Century-old Developmental Question
Embryologists have helped solve an evolutionary riddle that has been puzzling scientists for over a century. They have identified a key mechanism in the initial stages of an embryo's development that helps differentiate more highly evolved species, including humans, from lessevolved species, such as fish.

NASA Technology Helps Smooth Bumpy Airline Rides
Most airline passengers and flight crews have one thing in common: they don't like turbulence. Researchers at NASA's Langley Research Center in Hampton, Va., and AeroTech Research (USA), Inc., Newport News, Va., have developed an automatic turbulence reporting system.

File Sharing for Scientists
In the olden days, scientists used to send out paper reprints of their research papers to colleagues…maybe they still do. I get the occasional request for such an archaic entity for the items I have had published in Science, PNAS, and other journals.These days, you’re more likely to simply ask for an eprint of a [...]

File Sharing for Scientists is a post from: Sciencebase Science Blog

Volcano Under the City
Companion website to a Public Broadcasting Service (PBS) Nova program that follows a team of scientists studying Mount Nyiragongo, a volcano in eastern Congo. Dangers include molten lava and gas vents that release carbon dioxide so that there is a danger of asphyxiation. Features an evaluation of forecasting volcano eruptions, an anatomy of a volcano, and an overview of "some of the worst volcanic disasters of the past 400 years."Includes a teacher's guide and related links.

[Ironic] An Italian pensioner committed suicide after his wife fell in
Recalling the end of Romeo and Juliet, the 70-year-old man, Ettore, who had sat by his wife's bedside for four months after she slipped into a coma following a heart attack, finally gave up hope and gassed himself in the garage of his family home.Less than a day later, his wife, Rossana, woke up in her hospital bed in Padua and immediately asked for him.

Joe Janes, the Internet Public Library’s founding director, discusse
link: http://www.youtube.com/watch?v=sbf9brsPew0

Researchers Show Traditional Chinese Exercises Can Help Combat Diabete
A pilot study for Australia's first clinical trial to evaluate the effectiveness of traditional Chinese exercises in preventing the growing problem of diabetes has produced startling results

A New Species of Monkey Is Discovered in Tanzania: The First in Africa
Article about the 2005 discovery in Africa of the "'Highland Mangabey' (Lophocebus kipunji), a long-haired forest primate."Includes photos and audio of the mangabey's "honk-bark."The article also notes that in December 2004 "WCS researchers found a new species of macaque in India, followed by a new variety of titi monkey in Bolivia."From the Wildlife Conservation Society (WCS).




MP3 Music Downloads

Preview songs, Download Free Music,Burn CDs at ITunes.com
iTunes_RGB_9mm

 


Google




InformationQuickFind.com - Find Information Fast

Links | Privacy Policy | News |