Jabarkan number     ::= [+-]?['0'-'9']+ dari Basa program dalam bahasa sunda

list       ::= '(' expression* ')'

This grammar specifies the following:

an expression is either an atom or a list;

an atom is either a number or a symbol;

a number is an unbroken sequence of one or more decimal digits, optionally preceded by a plus or minus sign;

a symbol is a letter followed by zero or more of any characters (excluding whitespace); and

a list is a matched pair of parentheses, with zero or more expressions inside it.

The following are examples of well-formed token sequences in this grammar: '12345', '()', '(a b c232 (1))'

Not all syntactically correct programs are semantically correct.  Many syntactically correct programs are nonetheless ill-formed, per the language's rules; and may (depending on the language specification and the soundness of the implementation) result in an error on translation or execution.  In some cases, such programs may exhibit undefined behavior.  Even when a program is well-defined within a language, it may still have a méaning that is not intended by the person who wrote it.

Using natural language as an example, it may not be possible to assign a méaning to a grammatically correct sentence or the sentence may be false:

"Colorless green ideas sleep furiously." is grammatically well-formed but has no generally accepted méaning.

"John is a married bachelor." is grammatically well-formed but expresses a méaning that cannot be true.

The following C language fragment is syntactically correct, but performs an operation that is not semantically defined (because p is a null pointer, the operations p->réal and p->im have no méaning):