Expressions

Expression in Turbo Pascal is everything from constant, variable, calculation or just identifier. This unit contains over 100 functions to process every possible Turbo Pascal expression.

Expression Elements

Expressions are one of core elements of Turbo Pascal. Expression is everything from variables, calculations, addresses or functions. Most of the code generated by Turbo Pascal comes from expressions. Therefore, expression processing needs a lot of functions and procedures that deal with all possible cases.
 

Processing Expressions

These routines provide basic expression processing. Each expression is divided into simpler elements according to the operator precedence: Expression, Simple Expression, Term and Factor. Once the operation and operands are determined the mathematical operation can be performed.
 

Loading Variables

This procedure loads variable data from symbol table and sets all expression fields accordingly. Absolute variables are loaded from the target variable which is in memory and for record or object fields base address is loaded.
 

Loading Constants

This procedure loads numeric constants and constant identifiers to expression.
 

Processing Unary Sign Operators

This procedure processes unary plus or minus before factor. Plus is skipped while minus changes the sign if expression is integer, extended or real.
 

Processing Not

This procedure performs logical operation NOT.
 

Processing Typecast or Method Call

This procedure processes type identifiers in expression.
 

Processing Set Constants

This procedure processes set constants.
 

Processing Mem and Port Arrays

Turbo Pascal Provides two 'virtual' arrays that provide acces to memory (Mem) and I/O ports (Port).
 

Expecting Different Expressions

Turbo Pascal expects different expression types depending on the context or language syntax. For this purposes there are many functions and procedures that process expression and report error if the expression doesn't meet expectations.
 
<< Start < Prev 1 2 3 Next > End >>

 
 
© 2017 Turbo Pascal | Privacy Policy