parser

parser — 名詞

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.

Marcus 寫了一支小型解析器,讓他的 app 每晚讀取下載下來的 JSON 檔。

wrote a parser to read [format]

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

解析器讀到第 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.