Chapter 2: Notation in AVAP™ Introduction Notation in AVAP™ refers to the conventions and rules used to write and format code in the AVAP™ programming language. Notation is essential to ensure code readability and comprehension, as well as to establish a coherent and consistent syntax across all projects. General Conventions In AVAP™, several general notation conventions are followed, similar to those used in other programming languages like Python. Some of these conventions include: Indentation: Code is structured through indentation, using white spaces or tabs to indicate the hierarchy and structure of the code. It is recommended to use four spaces for each level of indentation. Case Sensitivity: AVAP™ is case-sensitive, meaning that identifiers, variable names, and keywords must be consistently written using the same capitalization format throughout the code. Comments: Comments are used to document the code and explain its functionality. Single-line comments begin with the // symbol, while multi-line comments start with /* and end with */. Specific Notation Rules In addition to general conventions, AVAP™ follows specific notation rules for different elements of the language, including: Variables: Variable names should be descriptive and meaningful, using lowercase letters and underscores to separate words if necessary for readability (e.g., variable_name). Functions: Function names should follow the same conventions as variables, with the addition of parentheses to indicate function parameters (e.g., function_name(parameter1, parameter2)). Constants: Constants are typically written in uppercase letters with underscores separating words (e.g., EXAMPLE_CONSTANT). The descriptions of lexical analysis and syntax use a modified Backus–Naur form (BNF) grammar notation. This uses the following style of definition: ::= ::= | ::= | | ::= "addVar(" "," ")" ::= "=" ::= """ """ ::= | ::= | ::= | ::= " " ::= | ::= | | ::= | ::= | ::= "+" | "-" | "*" | "/" ::= ::= any character except `" ` and `\` ::= "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "_" ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" Explanation: : A program is a list of statements. : A list of statements can be a single statement or a statement followed by another list of statements. : A statement can be a global assignment, a local assignment, or a command. : A global assignment follows the format addVar('value', variable_name). : A local assignment follows the Python syntax variable_name = value. : A string value is enclosed in double quotes and contains string content. : The content of a string can be a string part or a string part followed by more string content. : A string part can be literal text or a variable reference. : Text is a series of characters. : A variable reference follows the format $ variable . : A variable name can be a letter or a combination of letters. : A value can be a string value, a number, or an expression. : A number can be a digit or a series of digits. : An expression can be a value or a combination of two values with an operator. : An operator can be +, -, *, or /. : A command can be any valid command syntax. : A character can be any character except double quotes and the backslash. : A letter can be an alphabetical character, a digit, or an underscore. : A digit is a number from 0 to 9. This BNF notation covers the assignment of global and local variables, as well as variable substitution in strings. Practical Example // Definition of a variable example_variable = 10 // Definition of a function example_function(parameter): // Function body result = parameter * 2 return result // Function call result = example_function(example_variable) In this example, notation conventions are used to define a variable, a function, and to call the function with a parameter. Conclusions Notation in AVAP™ is a fundamental part of software development in the language. By following clear and consistent notation conventions, developers can write and maintain code more effectively, contributing to the readability, understanding, and maintainability of the code in projects of any size and complexity. With this understanding of notation in AVAP™, developers can write clean and structured code that is easy to understand and maintain over time.