syntax
構文
[C/U] 両方
複数形: syntaxes
syntaxは、言葉や記号がどのような順序で並ぶべきかという構造上の規則を指します。単に単語の意味を知っているだけでなく、それらを正しく組み合わせて意味のある文を作るためのルールを指すため、文法の中でも特に配列や構成に重点を置いた概念です。
言語学的な視点
自然言語において、syntaxは単語が組み合わさって句や節、そして文になる仕組みを指します。例えば、日本語と英語では主語、動詞、目的語の並び順が異なりますが、このような言語固有の構造的なルールがsyntaxに当たります。意味論であるsemanticsが何を意味するかを扱うのに対し、syntaxはどのように配置するかという形式的な側面を扱います。
コンピュータサイエンスにおける役割
プログラミング言語において、syntaxはコードが正しく実行されるために厳格に守らなければならない記述形式を指します。この規則に反している場合、コンパイラやインタプリタはsyntax error(構文エラー)を出力し、プログラムの実行を停止させます。人間が話す言語では多少の語順の間違いでも意味が通じることがありますが、コンピュータ言語のsyntaxは極めて厳格であり、カンマ一つや括弧一つの不足が致命的なエラーに繋がります。
Uncountable when referring to the general study of linguistic rules. Countable when referring to a specific set of rules for a particular programming language or dialect.
意味
例文
関連語
structurearrangementorganizationgrammarlinguisticslanguagesentencephraseclausewordmorphemephonologysemanticspragmaticsmorphologyparsingparserlexiconvocabularyconstituentmodifierpredicatesubjectobjectcomplementadjunctagreementconcordpermutationinflectionderivationcodingprogrammingcompilerinterpreteralgorithmcodescriptkeywordoperatoroperandexpressionstatementdeclarationvariablefunctionparameterargumentbracketdelimiterpunctuationtokentokenizationformal languageautomatonrecursionhierarchytreenodebranchrootlogicrulepatterncompositionformulationdialectidiomdiscourseutterancearticulationconstructionframeworksystemprotocolstandardspecification