Oppolzer - Informatik / Stanford Pascal Compiler


Home       Lebenslauf       Schwerpunkte       Kenntnisse       Seminare       Kunden       Projekte       Produkte       Blog       Stanford Pascal       Kontakt

The Stanford Pascal Compiler / Evolution Steps

Back to Compiler main page

SIZEOF usable on string constants

Compiler version: 10.2017

SIZEOF until now was only usable on type identifiers and on variables. When using it on a constant identified, a syntax error P103 was shown (IDENTIFIER IS NOT OF APPROPRIATE CLASS).

SIZEOF is now usable on const identifiers, too.

For example:


procedure INIT ( var SCB : SCAN_BLOCK ) ; const MSG1 = 'symbol not known to source program scanner' ; MSG2 = 'unexpected end of source file' ; MSG3 = 'unexpected char in options string' ; MSG4 = 'closing paranthese expected in options string' ; MSG5 = 'the rest of the options string will be ignored' ; var C : SCAN_ERRCLASS ; N : INTEGER ; begin (* INIT *) ... PASSCANF ( SCB , 'S' , 'S' , 1 , MSG1 , SIZEOF ( MSG1 ) ) ; PASSCANF ( SCB , 'S' , 'S' , 2 , MSG2 , SIZEOF ( MSG2 ) ) ; PASSCANF ( SCB , 'S' , 'S' , 3 , MSG3 , SIZEOF ( MSG3 ) ) ; PASSCANF ( SCB , 'S' , 'S' , 4 , MSG4 , SIZEOF ( MSG4 ) ) ; PASSCANF ( SCB , 'S' , 'S' , 5 , MSG5 , SIZEOF ( MSG5 ) ) ; end (* INIT *) ;

Back to Compiler main page