Parser: Difference between revisions

From Computer History Wiki
Jump to navigationJump to search
link new articles
m Avoid redir
 
Line 1: Line 1:
A '''parser''' is a piece of [[software]] which takes a stream of input with a known [[syntax]] and turns it into a sequence of 'tokens' which have a higher-level [[semantics]]. The output may be a simple list of tokens, or, more usually, a structured [[tree]]. The input is usually a simple stream of [[character]]s, but may be some other form of data.
A '''parser''' is a piece of [[software]] which takes a stream of input with a known [[syntax]] and turns it into a sequence of 'tokens' which have a higher-level [[semantics]]. The output may be a simple list of tokens, or, more usually, a structured [[tree]]. The input is usually a simple stream of [[character]]s, but may be some other form of data.


The most common forms of parsers are 'recursive descent', in which a series of [[function]]s may call each other, and 'table-driven', in which a formal grammar table is used to do the parsing.
The most common forms of parsers are 'recursive descent', in which a series of [[subroutine]]s may call each other, and 'table-driven', in which a formal grammar table is used to do the parsing.


{{semi-stub}}
{{semi-stub}}


[[Category: Software Concepts]]
[[Category: Software Concepts]]

Latest revision as of 12:37, 1 May 2025

A parser is a piece of software which takes a stream of input with a known syntax and turns it into a sequence of 'tokens' which have a higher-level semantics. The output may be a simple list of tokens, or, more usually, a structured tree. The input is usually a simple stream of characters, but may be some other form of data.

The most common forms of parsers are 'recursive descent', in which a series of subroutines may call each other, and 'table-driven', in which a formal grammar table is used to do the parsing.