syntax

syntax — 名詞

1. the set of rules in a language that control how words are arranged to form corre

1.名詞B2
釋義

句法

詞語排列成句的規則

the set of rules in a language that control how words are arranged to form correct phrases, clauses, and sentences

例句

The syntax of Japanese sentences differs greatly from that of English.

日語句子的句法與英語有很大不同。

comparative syntax across languages

Sari's English teacher helped her understand basic syntax through simple sentence diagrams.

Sari 的英語老師用簡單的句法圖解幫助她理解基本句法。

同義詞
  • grammar

    broader term that includes syntax, morphology, and punctuation rules

  • word order

    one aspect of syntax, specifically the sequence of words in a sentence

  • sentence structure

    more general term that overlaps with syntax but can also refer to length and complexity

用法筆記

Syntax is usually studied as an uncountable noun. In language education, it focuses on word order and sentence patterns — distinct from morphology, which deals with word forms like prefixes and suffixes.

常見錯誤

The syntax of this sentence are confusing.
The syntax of this sentence is confusing.
💡syntax is an uncountable noun and takes a singular verb.
Syntaxes vary across languages.
Syntax varies across languages.
💡do not pluralise syntax when referring to grammatical rules in general.

2. the rules that determine how commands, symbols, and punctuation must be written

2.名詞B2
釋義

語法

程式語言中指令的組合規則

the rules that determine how commands, symbols, and punctuation must be written in a programming language so that a computer can understand them

例句

Hao fixed the bug by checking the syntax of his Python code line by line.

Hao 逐行檢查他的 Python 程式碼的語法,修正了錯誤。

A single missing semicolon can break the syntax of an entire JavaScript program.

只要少一個分號,就可能破壞整段 JavaScript 程式的語法。

syntax error: missing punctuation

同義詞
  • coding rules

    informal term for the format requirements of a programming language

  • language structure

    focuses on the overall organisation of commands and expressions

  • format rules

    emphasises punctuation and indentation requirements

用法筆記

In computing, syntax can be countable (e.g. 'this language has two different syntaxes for loops') or uncountable. A syntax error means the code does not follow the language's required format and cannot be compiled or run.

常見錯誤

I need to fix the grammar of my code.
I need to fix the syntax of my code.
💡in programming, syntax refers to code structure; grammar describes natural language.

3. an organised structure in which the parts of something — such as music, art, or

3.名詞C1
釋義

結構

各部分有條理的編排方式

an organised structure in which the parts of something — such as music, art, or a system — are arranged in a clear, logical order

例句

The syntax of a musical composition can be as important as its melody.

一首音樂作品的結構和它的旋律同樣重要。

syntax + music composition

Art historians studied the syntax of the cathedral's architectural elements.

藝術史學者研究了大教堂建築元素的結構編排。

同義詞
  • structure

    simpler, more general term for how parts fit together

  • arrangement

    emphasises the order of elements rather than the rules behind the order

  • organisation

    focuses on how components are grouped or categorised

  • logic

    suggests an internal reasoning or principle behind the arrangement

反義詞
  • chaos

    complete lack of structure or order

用法筆記

This sense is used in formal, academic, or abstract contexts outside of language and computing. It often appears in discussions of music theory, art criticism, logic, or systems theory.

常見錯誤

The syntax of the painting was colourful.
The syntax of the painting followed a clear structure.
💡syntax refers to arrangement, not sensory qualities like colour.