The following is the NC Syntax in pseudo Backus-Naur form. (updated June 9, 2009)

syntax1
syntax2

Language features that the diagrams do not show

The diagrams above date from 2009 and do not include several parts of the current NC language:
  • The type-specifier rule lists only int, real and element. NC also accepts float (another name for real), string, coaxtype, vector, transform and void. The Language page describes each type.
  • The symbol-list rule does not show array declarations such as real a[10] ;. The Arrays page describes them.
  • The NC-Program rule does not show user function definitions, which start with a return type, a name and an argument list. An argument can be passed by reference with a * before its name. The User Functions and Arrays pages describe them.
  • The jump-statement rule shows only break. NC also has a return statement, with or without a value, which is described on the User Functions page.
  • The constant rule does not show the unit suffixes (", ', u, n and p) or the # prefix for AWG wire sizes. The Language page describes them.
  • The diagrams do not show #include directives, which NC replaces with the contents of the named file before it compiles the program.