parser
parser — 名詞
1. a tool, program, or person that takes a piece of text or code and breaks it into
解析器
把文字或程式碼拆解分析的工具或程式
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
Lina's research group built a parser for old Latin poetry to label every word's role in the sentence.
Lina 的研究團隊為古拉丁詩寫了一個解析器,用來標出每個字在句子裡的角色。
Most browsers include a fast HTML parser that turns the page's code into a visible layout.
大多數瀏覽器內建一個快速的 HTML 解析器,能把網頁的程式碼轉成看得到的版面。
Lina's Markdown parser crashed every time it hit a code block nested inside a list.
Lina 寫的 Markdown 解析器,每次遇到清單裡又夾著程式碼區塊就當掉。
- 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.