parser

parser — noun

1. a tool, program, or person that takes a piece of text or code and breaks it into

1.名詞C1
釋義

a tool, program, or person that takes a piece of text or code and breaks it into smaller parts so that the structure and meaning of each part can be checked.

例句

Marcus wrote a small parser to read the JSON files his app downloaded each night.

wrote a parser to read [format]

The parser threw an error when it reached a missing comma on line 47.

the parser threw an error

同義詞
  • analyzer

    broader; any tool that examines data, not just for structure

  • interpreter

    in computing, runs the parsed code rather than just checking its shape

  • lexer

    narrower; splits input into tokens, which a parser then groups into structures

文法句型

a parser for [language/format]

用法筆記

Almost always refers to a piece of software in modern use; the older sense of a person who parses sentences in school grammar lessons is now rare. Often paired with the format it handles: HTML parser, JSON parser, XML parser.

常見錯誤

I used a parser to write the code.
I used a parser to read the code.
💡a parser reads and analyzes input; it does not generate code.
The parser is a kind of compiler.
The parser is one part of a compiler.
💡a compiler usually contains a parser as a step, but the two are not the same thing.