---
title: "Syntax — AP Computer Science Principles Definition"
description: "Syntax is the set of rules for how code must be written in a language, covering keywords, punctuation, and structure. Learn how AP CSP tests it via pseudocode."
canonical: "https://fiveable.me/ap-comp-sci-p/key-terms/syntax"
type: "key-term"
subject: "AP Computer Science Principles"
---

# Syntax — AP Computer Science Principles Definition

## Definition

Syntax refers to the set of rules specific to a programming language that dictate how programs should be written. It includes guidelines for using keywords, punctuation, and structures correctly.

## Review

### Related Terms

- Keyword: A reserved word in a programming language that has special meaning and is used for specific purposes.
- Punctuation: Characters such as commas, semicolons, parentheses, etc., used to structure code and separate different elements.
- Structure: The organization and arrangement of code blocks, statements, functions, and data within a program.
