parser
Word family
- parseverbC1
- parsingnounC1
- parsableadjectiveC2
- unparseableadjectiveC2
Synonym discussion
Sense: noun/1
These four words name different stages of how software handles code or text. A lexer scans raw input and groups characters into tokens like keywords, numbers, and punctuation; it does not care about how those tokens fit together. A parser takes the tokens from a lexer and checks whether they form a valid structure, building a tree that shows how each piece relates to the others. An interpreter goes one step further: it walks through that structure and actually runs the instructions, line by line. A compiler also uses a parser inside it, but instead of running the code, it translates the whole program into another form, such as machine code, which a computer can run later. So if you write 'x = 3 + 4', the lexer sees four tokens, the parser sees an assignment with an addition inside, the interpreter would set x to 7 right away, and a compiler would produce a file that does the same thing every time it is launched.
Common collocations
Nouns
- JSON parser
- HTML parser
- XML parser
- command-line parser
- parser error
- parser library
Phrases
- write a parser
- build a parser
- the parser fails
- run through the parser
Prepositions
- parser for
- parser in
Etymology
From the verb 'parse', which entered English in the 1500s in Latin grammar schools, where pupils were asked to name each word in a sentence by its part of speech. 'Parse' itself comes from the Latin question 'pars orationis?' meaning 'which part of speech?'. The '-er' ending names a person or thing that does the action, so a parser was first a pupil or teacher doing this exercise. From the late 1900s, computer scientists borrowed the word for software that does a similar job on programming code, and this is now its main meaning.