Allen Young

Some notes on writing a Java software program (pt2)


Listen Later

https://youtu.be/If5NY_p12Sk
In other words, Java lexical grammars specify how to form the identifiers, keywords, literals, separators, and operators (i.e. the most fundamental language elements) in the Java programming language.The syntactic grammar for the Java programming language has as its terminal symbols the tokens defined by the lexical grammar. It defines a set of productions, starting from the goalsymbol CompilationUnit, that describe how sequences of tokens can form syntactically correct programs.(Early-plugs insertion point. A few seconds of silence in audiovisual.)Refer to the NormalClassDeclaration syntactic grammar in Java language spec for how to define a class in Java.The lexical structure of the Java programming language enables using Unicode escapes to include any Unicode character using only ASCII characters.In the Java programming language, the Unicode characters resulting from the lexical translations are reduced to a sequence of input elements, which are white space, comments, and tokens. The tokens are the identifiers, keywords, literals, separators, and operators of the syntactic grammar.The Java programs are written using the Unicode character set.The Java programming language represents text in sequences of 16-bit code units, using the UTF-16 encoding.Except for comments, identifiers, and the contents of character literals, string literals, and text blocks, all input elements in a program are formed only from ASCII characters (or Unicode escapes which result in ASCII characters.In the Java programming language, a token is an identifier, a keyword, a literal, a separator, or an operator. The tokens are the terminal symbols of the syntactic grammar.The Java programming language has two kinds of comments: the traditional comment, and the end-of-line comment.The Java programming language has character literals, string literals, or text blocks.In the Java programming language, an identifier is an unlimited-length sequence of Java letters and Java digits, the first of which must be a Java letter. The underscore may be used in identifiers formed of two or more characters, but it cannot be used as a one-character identifier due to being a keyword.In the Java programming language, identifiers can be written in non-Latin characters, in any Unicode characters.In the Java programming language, an identifier never has the same spelling (Unicode character sequence) as a reserved keyword, a boolean literal or the null literal.TypeIdentifier is used in the declaration of classes, interfaces, and type parameters, and when referring to types.
...more
View all episodesView all episodes
Download on the App Store

Allen YoungBy Allen Young