Spellcheck comments throughout the code.
There are no non-comment changes.
This commit is contained in:
parent
d60104cc47
commit
ffe6c4e924
10
CCommon.pas
10
CCommon.pas
|
@ -42,7 +42,7 @@
|
||||||
{ value of constant expressions in this variable }
|
{ value of constant expressions in this variable }
|
||||||
{ expressionType - the type of the expression }
|
{ expressionType - the type of the expression }
|
||||||
{ expressionTree - for non-constant initializers }
|
{ expressionTree - for non-constant initializers }
|
||||||
{ isConstant - is the initializer expression conastant? }
|
{ isConstant - is the initializer expression constant? }
|
||||||
{ typeSpec - type given by the last declaration specifiers, }
|
{ typeSpec - type given by the last declaration specifiers, }
|
||||||
{ specifier-qualifier list, or type name evaluated }
|
{ specifier-qualifier list, or type name evaluated }
|
||||||
{ }
|
{ }
|
||||||
|
@ -123,7 +123,7 @@ type
|
||||||
pString = packed array [0..maxLine] of char; {length string}
|
pString = packed array [0..maxLine] of char; {length string}
|
||||||
stringPtr = ^pString;
|
stringPtr = ^pString;
|
||||||
ptr = ^byte; {general purpose pointer}
|
ptr = ^byte; {general purpose pointer}
|
||||||
handle = ^ptr; {gereral purpose handle}
|
handle = ^ptr; {general purpose handle}
|
||||||
|
|
||||||
gsosInString = record
|
gsosInString = record
|
||||||
size: integer;
|
size: integer;
|
||||||
|
@ -139,9 +139,9 @@ type
|
||||||
gsosOutStringPtr = ^gsosOutString;
|
gsosOutStringPtr = ^gsosOutString;
|
||||||
|
|
||||||
{ The base types include two main categories. The values starting }
|
{ The base types include two main categories. The values starting }
|
||||||
{ with cg are defined in the code generater, and may be passed to the }
|
{ with cg are defined in the code generator, and may be passed to the }
|
||||||
{ code generator for resolution. The cc types are used internally in }
|
{ code generator for resolution. The cc types are used internally in }
|
||||||
{ the compiler. Any values whose type is cc must be resulved to one }
|
{ the compiler. Any values whose type is cc must be resolved to one }
|
||||||
{ of the cg types before the code generator is called. }
|
{ of the cg types before the code generator is called. }
|
||||||
|
|
||||||
baseTypeEnum = (cgByte,cgUByte,cgWord,cgUWord,cgLong,cgULong,
|
baseTypeEnum = (cgByte,cgUByte,cgWord,cgUWord,cgLong,cgULong,
|
||||||
|
@ -475,7 +475,7 @@ var
|
||||||
expressionValue: longint; {value of the last constant expression}
|
expressionValue: longint; {value of the last constant expression}
|
||||||
expressionType: typePtr; {the type of the expression}
|
expressionType: typePtr; {the type of the expression}
|
||||||
initializerTree: tokenPtr; {for non-constant initializers}
|
initializerTree: tokenPtr; {for non-constant initializers}
|
||||||
isConstant: boolean; {is the initializer expression conastant?}
|
isConstant: boolean; {is the initializer expression constant?}
|
||||||
|
|
||||||
{type specifier results}
|
{type specifier results}
|
||||||
{----------------------}
|
{----------------------}
|
||||||
|
|
4
CGC.pas
4
CGC.pas
|
@ -38,8 +38,8 @@ type
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
{msc}
|
{misc}
|
||||||
{---}
|
{----}
|
||||||
blkcnt: longint; {number of bytes in current segment}
|
blkcnt: longint; {number of bytes in current segment}
|
||||||
|
|
||||||
{buffers}
|
{buffers}
|
||||||
|
|
8
CGI.pas
8
CGI.pas
|
@ -5,7 +5,7 @@
|
||||||
{ }
|
{ }
|
||||||
{ This unit serves as the glue code attaching a compiler }
|
{ This unit serves as the glue code attaching a compiler }
|
||||||
{ to the code generator. It provides subroutines in a }
|
{ to the code generator. It provides subroutines in a }
|
||||||
{ format that is convinient for the compiler during }
|
{ format that is convenient for the compiler during }
|
||||||
{ semantic analysis, and produces intermediate code records }
|
{ semantic analysis, and produces intermediate code records }
|
||||||
{ as output. These intermediate code records are then }
|
{ as output. These intermediate code records are then }
|
||||||
{ passed on to the code generator for optimization and }
|
{ passed on to the code generator for optimization and }
|
||||||
|
@ -327,7 +327,7 @@ var
|
||||||
stringsize: 0..maxstring; {amount of string space left}
|
stringsize: 0..maxstring; {amount of string space left}
|
||||||
stringspace: packed array[1..maxstring] of char; {string table}
|
stringspace: packed array[1..maxstring] of char; {string table}
|
||||||
symLength: integer; {length of debug symbol table}
|
symLength: integer; {length of debug symbol table}
|
||||||
toolParms: boolean; {generate tool format paramaters?}
|
toolParms: boolean; {generate tool format parameters?}
|
||||||
volatile: boolean; {has a volatile qualifier been used?}
|
volatile: boolean; {has a volatile qualifier been used?}
|
||||||
hasVarargsCall: boolean; {does current function call any varargs fns?}
|
hasVarargsCall: boolean; {does current function call any varargs fns?}
|
||||||
|
|
||||||
|
@ -769,7 +769,7 @@ profileFlag := false; {don't generate profiling code}
|
||||||
debugFlag := false; {don't generate debug code}
|
debugFlag := false; {don't generate debug code}
|
||||||
debugStrFlag := false; {don't generate gsbug debug strings}
|
debugStrFlag := false; {don't generate gsbug debug strings}
|
||||||
traceBack := false; {don't generate traceback code}
|
traceBack := false; {don't generate traceback code}
|
||||||
volatile := false; {no volatile quialifiers found}
|
volatile := false; {no volatile qualifiers found}
|
||||||
|
|
||||||
registers := cLineOptimize; {don't do register optimizations}
|
registers := cLineOptimize; {don't do register optimizations}
|
||||||
peepHole := cLineOptimize; {not doing peephole optimization (yet)}
|
peepHole := cLineOptimize; {not doing peephole optimization (yet)}
|
||||||
|
@ -799,7 +799,7 @@ if codeGeneration then begin
|
||||||
{ WriteCode(code); {debug}
|
{ WriteCode(code); {debug}
|
||||||
DAG(code); {generate the code}
|
DAG(code); {generate the code}
|
||||||
|
|
||||||
{initialize volitile variables for next intermediate code}
|
{initialize volatile variables for next intermediate code}
|
||||||
code := pointer(Calloc(sizeof(intermediate_code)));
|
code := pointer(Calloc(sizeof(intermediate_code)));
|
||||||
{code^.lab := nil;}
|
{code^.lab := nil;}
|
||||||
code^.optype := cgWord;
|
code^.optype := cgWord;
|
||||||
|
|
6
DAG.pas
6
DAG.pas
|
@ -64,7 +64,7 @@ function CodesMatch (op1, op2: icptr; exact: boolean): boolean;
|
||||||
|
|
||||||
function LongStrCmp (s1, s2: longStringPtr): boolean;
|
function LongStrCmp (s1, s2: longStringPtr): boolean;
|
||||||
|
|
||||||
{ Are the strings s1 amd s2 equal? }
|
{ Are the strings s1 and s2 equal? }
|
||||||
{ }
|
{ }
|
||||||
{ parameters: }
|
{ parameters: }
|
||||||
{ s1, s2 - strings to compare }
|
{ s1, s2 - strings to compare }
|
||||||
|
@ -3815,7 +3815,7 @@ var
|
||||||
{ }
|
{ }
|
||||||
{ Returns: True if the store is valid, false if not. }
|
{ Returns: True if the store is valid, false if not. }
|
||||||
{ }
|
{ }
|
||||||
{ Notes: Specifically, these two rules are inforced: }
|
{ Notes: Specifically, these two rules are enforced: }
|
||||||
{ 1. No other stores to the same location appear in the }
|
{ 1. No other stores to the same location appear in the }
|
||||||
{ loop. }
|
{ loop. }
|
||||||
{ 2. All uses of the value in the loop can be reached }
|
{ 2. All uses of the value in the loop can be reached }
|
||||||
|
@ -4083,7 +4083,7 @@ var
|
||||||
end; {if}
|
end; {if}
|
||||||
end {else if}
|
end {else if}
|
||||||
else if opcode in [pc_ldo,pc_lod] then begin
|
else if opcode in [pc_ldo,pc_lod] then begin
|
||||||
{invariant if there is an immediately preceeding invariant store}
|
{invariant if there is an immediately preceding invariant store}
|
||||||
if PreviousStore(op, lp2^.block^.code) then begin
|
if PreviousStore(op, lp2^.block^.code) then begin
|
||||||
op^.parents := icount;
|
op^.parents := icount;
|
||||||
icount := icount+1;
|
icount := icount+1;
|
||||||
|
|
|
@ -342,7 +342,7 @@ ml1 lda ans SYSS1*SYSS1+2+SYSS1+2 -> SYSS1,SYSS1+2
|
||||||
lda ans+6
|
lda ans+6
|
||||||
adc num2+2
|
adc num2+2
|
||||||
sta ans+6
|
sta ans+6
|
||||||
ml2 ror ans+6 shift the interem result
|
ml2 ror ans+6 shift the interim result
|
||||||
ror ans+4
|
ror ans+4
|
||||||
ror ans+2
|
ror ans+2
|
||||||
ror ans
|
ror ans
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
{ GenerateCode - generate code from a fully formed expression }
|
{ GenerateCode - generate code from a fully formed expression }
|
||||||
{ tree }
|
{ tree }
|
||||||
{ GetTemp - find a temporary work variable }
|
{ GetTemp - find a temporary work variable }
|
||||||
{ InitExpression - initlialize the expression handler }
|
{ InitExpression - initialize the expression handler }
|
||||||
{ UsualBinaryConversions - performs the usual binary }
|
{ UsualBinaryConversions - performs the usual binary }
|
||||||
{ conversions }
|
{ conversions }
|
||||||
{ UsualUnaryConversions - performs the usual unary conversions }
|
{ UsualUnaryConversions - performs the usual unary conversions }
|
||||||
|
@ -119,7 +119,7 @@ procedure DoSelection (lType: typePtr; tree: tokenPtr; var size: longint);
|
||||||
{ unsigned - is the bit field unsigned? }
|
{ unsigned - is the bit field unsigned? }
|
||||||
{ isBitField - is the field a bit field? }
|
{ isBitField - is the field a bit field? }
|
||||||
{ }
|
{ }
|
||||||
{ varaibles: }
|
{ variables: }
|
||||||
{ expressionType - set to the type of the field }
|
{ expressionType - set to the type of the field }
|
||||||
|
|
||||||
|
|
||||||
|
@ -835,7 +835,7 @@ var
|
||||||
Error(31);
|
Error(31);
|
||||||
errorFound := true;
|
errorFound := true;
|
||||||
end; {else}
|
end; {else}
|
||||||
end {if id = nill}
|
end {if id = nil}
|
||||||
else if id^.itype^.kind = enumConst then begin
|
else if id^.itype^.kind = enumConst then begin
|
||||||
stack^.token.class := intConstant;
|
stack^.token.class := intConstant;
|
||||||
stack^.token.kind := intconst;
|
stack^.token.kind := intconst;
|
||||||
|
@ -1402,7 +1402,7 @@ var
|
||||||
|
|
||||||
procedure Skip;
|
procedure Skip;
|
||||||
|
|
||||||
{ skip all tokens in the reminader of the expression }
|
{ skip all tokens in the remainder of the expression }
|
||||||
|
|
||||||
begin {Skip}
|
begin {Skip}
|
||||||
while not (token.kind in stopSym+[eofsy]) do
|
while not (token.kind in stopSym+[eofsy]) do
|
||||||
|
@ -1630,7 +1630,7 @@ if token.kind in startExpression then begin
|
||||||
dispose(op);
|
dispose(op);
|
||||||
end {if}
|
end {if}
|
||||||
else begin
|
else begin
|
||||||
done2 := false; {do operations with less precidence}
|
done2 := false; {do operations with less precedence}
|
||||||
repeat
|
repeat
|
||||||
if opStack = nil then
|
if opStack = nil then
|
||||||
done2 := true
|
done2 := true
|
||||||
|
@ -1936,7 +1936,7 @@ procedure DoSelection {lType: typePtr; tree: tokenPtr; var size: longint};
|
||||||
{ unsigned - is the bit field unsigned? }
|
{ unsigned - is the bit field unsigned? }
|
||||||
{ isBitField - is the field a bit field? }
|
{ isBitField - is the field a bit field? }
|
||||||
{ }
|
{ }
|
||||||
{ varaibles: }
|
{ variables: }
|
||||||
{ expressionType - set to the type of the field }
|
{ expressionType - set to the type of the field }
|
||||||
|
|
||||||
label 1;
|
label 1;
|
||||||
|
@ -2115,7 +2115,7 @@ var
|
||||||
|
|
||||||
{ returns the type of an expression }
|
{ returns the type of an expression }
|
||||||
{ }
|
{ }
|
||||||
{ This subroutine is used to see if + and - operarions }
|
{ This subroutine is used to see if + and - operations }
|
||||||
{ should do pointer addition. }
|
{ should do pointer addition. }
|
||||||
{ }
|
{ }
|
||||||
{ parameters: }
|
{ parameters: }
|
||||||
|
@ -2138,7 +2138,7 @@ var
|
||||||
expressionType := expressionType^.dType;
|
expressionType := expressionType^.dType;
|
||||||
ExpressionKind := expressionType^.kind;
|
ExpressionKind := expressionType^.kind;
|
||||||
|
|
||||||
doDispose := ldoDispose; {resore the volitile variables}
|
doDispose := ldoDispose; {restore the volatile variables}
|
||||||
codeGeneration := lCodeGeneration and (numErrors = 0);
|
codeGeneration := lCodeGeneration and (numErrors = 0);
|
||||||
expressionType := lexpressionType;
|
expressionType := lexpressionType;
|
||||||
end; {ExpressionKind}
|
end; {ExpressionKind}
|
||||||
|
|
2
Gen.pas
2
Gen.pas
|
@ -52,7 +52,7 @@ const
|
||||||
|
|
||||||
type
|
type
|
||||||
{possible locations for 4 byte values}
|
{possible locations for 4 byte values}
|
||||||
longType = record {desciption of current four byte value}
|
longType = record {description of current four byte value}
|
||||||
preference: integer; {where you want the value}
|
preference: integer; {where you want the value}
|
||||||
where: integer; {where the value is at}
|
where: integer; {where the value is at}
|
||||||
fixedDisp: boolean; {is the displacement a fixed value?}
|
fixedDisp: boolean; {is the displacement a fixed value?}
|
||||||
|
|
|
@ -174,7 +174,7 @@ type
|
||||||
|
|
||||||
var
|
var
|
||||||
codeStarted: boolean; {has code generation started?}
|
codeStarted: boolean; {has code generation started?}
|
||||||
includeLevel: 0..maxint; {nexted include level}
|
includeLevel: 0..maxint; {nested include level}
|
||||||
includeMark: boolean; {has the mark field been written?}
|
includeMark: boolean; {has the mark field been written?}
|
||||||
savePragmas: set of pragmas; {pragmas to record}
|
savePragmas: set of pragmas; {pragmas to record}
|
||||||
saveSource: boolean; {save source streams?}
|
saveSource: boolean; {save source streams?}
|
||||||
|
|
|
@ -359,7 +359,7 @@ var
|
||||||
end;
|
end;
|
||||||
count: integer; {number of constants to repeat}
|
count: integer; {number of constants to repeat}
|
||||||
i,j,k: integer; {loop variables}
|
i,j,k: integer; {loop variables}
|
||||||
lsegDisp: longint; {for backtracking while writting the }
|
lsegDisp: longint; {for backtracking while writing the }
|
||||||
{ debugger's symbol table }
|
{ debugger's symbol table }
|
||||||
lval: longint; {temp storage for long constant}
|
lval: longint; {temp storage for long constant}
|
||||||
nptr: stringPtr; {pointer to a name}
|
nptr: stringPtr; {pointer to a name}
|
||||||
|
@ -1437,7 +1437,7 @@ var
|
||||||
|
|
||||||
function SignExtension (ns: integer): boolean;
|
function SignExtension (ns: integer): boolean;
|
||||||
|
|
||||||
{ See if the pattern is a sugn extension }
|
{ See if the pattern is a sign extension }
|
||||||
{ }
|
{ }
|
||||||
{ Parameters: }
|
{ Parameters: }
|
||||||
{ ns - start of suspected pattern }
|
{ ns - start of suspected pattern }
|
||||||
|
@ -2074,7 +2074,7 @@ procedure InitFile {keepName: gsosOutStringPtr; keepFlag: integer; partial: bool
|
||||||
|
|
||||||
var
|
var
|
||||||
i: integer; {loop index}
|
i: integer; {loop index}
|
||||||
lab: stringPtr; {for holdling names var pointers}
|
lab: stringPtr; {for holding names var pointers}
|
||||||
menuLen: integer; {length of the menu name string}
|
menuLen: integer; {length of the menu name string}
|
||||||
|
|
||||||
|
|
||||||
|
|
24
Parser.pas
24
Parser.pas
|
@ -155,7 +155,7 @@ var
|
||||||
firstCompoundStatement: boolean; {are we doing a function level compound statement?}
|
firstCompoundStatement: boolean; {are we doing a function level compound statement?}
|
||||||
fType: typePtr; {return type of the current function}
|
fType: typePtr; {return type of the current function}
|
||||||
isForwardDeclared: boolean; {is the field list component }
|
isForwardDeclared: boolean; {is the field list component }
|
||||||
{ referenceing a forward struct/union? }
|
{ referencing a forward struct/union? }
|
||||||
isFunction: boolean; {is the declaration a function?}
|
isFunction: boolean; {is the declaration a function?}
|
||||||
isPascal: boolean; {has the pascal modifier been used?}
|
isPascal: boolean; {has the pascal modifier been used?}
|
||||||
{ (set by DoDeclaration)}
|
{ (set by DoDeclaration)}
|
||||||
|
@ -236,7 +236,7 @@ procedure GotoLabel (op: pcodes);
|
||||||
{ does not already exist. Generate the label or a jump to it }
|
{ does not already exist. Generate the label or a jump to it }
|
||||||
{ based on op. }
|
{ based on op. }
|
||||||
{ }
|
{ }
|
||||||
{ paremeters: }
|
{ parameters: }
|
||||||
{ op - operation code to create }
|
{ op - operation code to create }
|
||||||
|
|
||||||
label 1;
|
label 1;
|
||||||
|
@ -279,7 +279,7 @@ procedure CompoundStatement (makeSymbols: boolean);
|
||||||
{ }
|
{ }
|
||||||
{ Parameters: }
|
{ Parameters: }
|
||||||
{ makeSymbols - create a symbol table? (False for a }
|
{ makeSymbols - create a symbol table? (False for a }
|
||||||
{ function's outer wrapper, true for imbeded statements) }
|
{ function's outer wrapper, true for imbedded statements) }
|
||||||
|
|
||||||
var
|
var
|
||||||
stPtr: statementPtr; {for creating a compound statement record}
|
stPtr: statementPtr; {for creating a compound statement record}
|
||||||
|
@ -398,7 +398,7 @@ var
|
||||||
|
|
||||||
procedure AssignmentStatement;
|
procedure AssignmentStatement;
|
||||||
|
|
||||||
{ handle an asignment statement }
|
{ handle an assignment statement }
|
||||||
|
|
||||||
begin {AssignmentStatement}
|
begin {AssignmentStatement}
|
||||||
if token.kind in startExpression then begin
|
if token.kind in startExpression then begin
|
||||||
|
@ -1032,7 +1032,7 @@ if tl <> nil then begin
|
||||||
NextToken; {evaluate the expression}
|
NextToken; {evaluate the expression}
|
||||||
Expression(normalExpression, [semicolonch]);
|
Expression(normalExpression, [semicolonch]);
|
||||||
Gen0t(pc_pop, UsualUnaryConversions);
|
Gen0t(pc_pop, UsualUnaryConversions);
|
||||||
NextToken; {skip the seminolon}
|
NextToken; {skip the semicolon}
|
||||||
printMacroExpansions := lPrintMacroExpansions;
|
printMacroExpansions := lPrintMacroExpansions;
|
||||||
end; {if}
|
end; {if}
|
||||||
|
|
||||||
|
@ -1185,7 +1185,7 @@ type
|
||||||
|
|
||||||
var
|
var
|
||||||
i: integer; {loop variable}
|
i: integer; {loop variable}
|
||||||
lastWasIdentifier: boolean; {for deciding if the declarator is a fuction}
|
lastWasIdentifier: boolean; {for deciding if the declarator is a function}
|
||||||
lastWasPointer: boolean; {was the last type a pointer?}
|
lastWasPointer: boolean; {was the last type a pointer?}
|
||||||
newName: stringPtr; {new symbol name}
|
newName: stringPtr; {new symbol name}
|
||||||
parameterStorage: boolean; {is the new symbol in a parm list?}
|
parameterStorage: boolean; {is the new symbol in a parm list?}
|
||||||
|
@ -2301,7 +2301,7 @@ var
|
||||||
|
|
||||||
procedure RecomputeSizes (tp: typePtr);
|
procedure RecomputeSizes (tp: typePtr);
|
||||||
|
|
||||||
{ a size has been infered from an initializer - set the }
|
{ a size has been inferred from an initializer - set the }
|
||||||
{ appropriate type size values }
|
{ appropriate type size values }
|
||||||
{ }
|
{ }
|
||||||
{ parameters: }
|
{ parameters: }
|
||||||
|
@ -2561,7 +2561,7 @@ procedure DeclarationSpecifiers (allowedTokens: tokenSet;
|
||||||
{ }
|
{ }
|
||||||
{ outputs: }
|
{ outputs: }
|
||||||
{ isForwardDeclared - is the field list component }
|
{ isForwardDeclared - is the field list component }
|
||||||
{ referenceing a forward struct/union? }
|
{ referencing a forward struct/union? }
|
||||||
{ skipDeclarator - for enum,struct,union with no }
|
{ skipDeclarator - for enum,struct,union with no }
|
||||||
{ declarator }
|
{ declarator }
|
||||||
{ typespec - type specifier }
|
{ typespec - type specifier }
|
||||||
|
@ -3827,7 +3827,7 @@ var
|
||||||
{ nonempty-abstract-declarator: }
|
{ nonempty-abstract-declarator: }
|
||||||
{ ( nonempty-abstract-declarator ) }
|
{ ( nonempty-abstract-declarator ) }
|
||||||
{ abstract-declarator ( ) }
|
{ abstract-declarator ( ) }
|
||||||
{ abstract-declaraotr [ expression OPT ] }
|
{ abstract-declarator [ expression OPT ] }
|
||||||
{ * abstract-declarator }
|
{ * abstract-declarator }
|
||||||
|
|
||||||
var
|
var
|
||||||
|
@ -3858,7 +3858,7 @@ var
|
||||||
end {if}
|
end {if}
|
||||||
else begin
|
else begin
|
||||||
|
|
||||||
{handle a perenthesized type}
|
{handle a parenthesized type}
|
||||||
if not (token.kind in [lparench,asteriskch,lbrackch]) then
|
if not (token.kind in [lparench,asteriskch,lbrackch]) then
|
||||||
begin
|
begin
|
||||||
Error(82);
|
Error(82);
|
||||||
|
@ -4125,7 +4125,7 @@ var
|
||||||
{ parameters: }
|
{ parameters: }
|
||||||
{ elements - elements in the array }
|
{ elements - elements in the array }
|
||||||
{ itype - type of each array element }
|
{ itype - type of each array element }
|
||||||
{ count - remaining initializer repititions }
|
{ count - remaining initializer repetitions }
|
||||||
{ iPtr - initializer record }
|
{ iPtr - initializer record }
|
||||||
|
|
||||||
begin {ZeroFill}
|
begin {ZeroFill}
|
||||||
|
@ -4248,7 +4248,7 @@ var
|
||||||
endDisp := disp + itype^.size;
|
endDisp := disp + itype^.size;
|
||||||
if iPtr^.isStructOrUnion then begin
|
if iPtr^.isStructOrUnion then begin
|
||||||
LoadAddress; {load the destination address}
|
LoadAddress; {load the destination address}
|
||||||
GenerateCode(iptr^.iTree); {load the stuct address}
|
GenerateCode(iptr^.iTree); {load the struct address}
|
||||||
{do the assignment}
|
{do the assignment}
|
||||||
AssignmentConversion(itype, expressionType, isConstant, val,
|
AssignmentConversion(itype, expressionType, isConstant, val,
|
||||||
true, false);
|
true, false);
|
||||||
|
|
|
@ -55,7 +55,7 @@ lb2 iny next character
|
||||||
|
|
||||||
****************************************************************
|
****************************************************************
|
||||||
*
|
*
|
||||||
* KeyPress - Has a key been presed?
|
* KeyPress - Has a key been pressed?
|
||||||
*
|
*
|
||||||
* If a key has not been pressed, this function returns
|
* If a key has not been pressed, this function returns
|
||||||
* false. If a key has been pressed, it clears the key
|
* false. If a key has been pressed, it clears the key
|
||||||
|
|
10
Scanner.pas
10
Scanner.pas
|
@ -237,7 +237,7 @@ type
|
||||||
var
|
var
|
||||||
dateStr: longStringPtr; {macro date string}
|
dateStr: longStringPtr; {macro date string}
|
||||||
doingPPExpression: boolean; {are we processing a preprocessor expression?}
|
doingPPExpression: boolean; {are we processing a preprocessor expression?}
|
||||||
doingstring: boolean; {used to supress comments in strings}
|
doingstring: boolean; {used to suppress comments in strings}
|
||||||
errors: array[1..maxErr] of errorType; {errors in this line}
|
errors: array[1..maxErr] of errorType; {errors in this line}
|
||||||
eofPtr: ptr; {points one byte past the last char in the file}
|
eofPtr: ptr; {points one byte past the last char in the file}
|
||||||
fileList: filePtr; {include file list}
|
fileList: filePtr; {include file list}
|
||||||
|
@ -268,7 +268,7 @@ var
|
||||||
ucnString: string[10]; {string of a UCN}
|
ucnString: string[10]; {string of a UCN}
|
||||||
lintErrors: set of 1..maxLint; {lint error codes}
|
lintErrors: set of 1..maxLint; {lint error codes}
|
||||||
|
|
||||||
{-- External procedures; see expresssion evaluator for notes ---}
|
{-- External procedures; see expression evaluator for notes ----}
|
||||||
|
|
||||||
procedure EndInclude (chPtr: ptr); extern;
|
procedure EndInclude (chPtr: ptr); extern;
|
||||||
|
|
||||||
|
@ -406,7 +406,7 @@ end; {AddPath}
|
||||||
function Convertsl(var str: pString): longint; extern;
|
function Convertsl(var str: pString): longint; extern;
|
||||||
|
|
||||||
{ Return the integer equivalent of the string. Assumes a valid }
|
{ Return the integer equivalent of the string. Assumes a valid }
|
||||||
{ 4-byte integer string; supporst unsigned values. }
|
{ 4-byte integer string; supports unsigned values. }
|
||||||
|
|
||||||
|
|
||||||
procedure SetDateTime; extern;
|
procedure SetDateTime; extern;
|
||||||
|
@ -416,7 +416,7 @@ procedure SetDateTime; extern;
|
||||||
|
|
||||||
function KeyPress: boolean; extern;
|
function KeyPress: boolean; extern;
|
||||||
|
|
||||||
{ Has a key been presed? }
|
{ Has a key been pressed? }
|
||||||
{ }
|
{ }
|
||||||
{ If a key has not been pressed, this function returns }
|
{ If a key has not been pressed, this function returns }
|
||||||
{ false. If a key has been pressed, it clears the key }
|
{ false. If a key has been pressed, it clears the key }
|
||||||
|
@ -3432,7 +3432,7 @@ var
|
||||||
lch: char; {next command line character}
|
lch: char; {next command line character}
|
||||||
cp: ptr; {character pointer}
|
cp: ptr; {character pointer}
|
||||||
i: 0..hashSize; {loop variable}
|
i: 0..hashSize; {loop variable}
|
||||||
negative: boolean; {is a number nagative?}
|
negative: boolean; {is a number negative?}
|
||||||
|
|
||||||
mp: macroRecordPtr; {for building the predefined macros}
|
mp: macroRecordPtr; {for building the predefined macros}
|
||||||
bp: ^macroRecordPtr;
|
bp: ^macroRecordPtr;
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
{ voidPtrPtr - typeless pointer, for some type casting }
|
{ voidPtrPtr - typeless pointer, for some type casting }
|
||||||
{ stringTypePtr - pointer to the base type for string }
|
{ stringTypePtr - pointer to the base type for string }
|
||||||
{ constants }
|
{ constants }
|
||||||
{ defaultStruc - default for structures with errors }
|
{ defaultStruct - default for structures with errors }
|
||||||
{ }
|
{ }
|
||||||
{---------------------------------------------------------------}
|
{---------------------------------------------------------------}
|
||||||
|
|
||||||
|
@ -942,7 +942,7 @@ var
|
||||||
|
|
||||||
procedure WriteScalarType (tp: typePtr; modifiers, subscripts: integer);
|
procedure WriteScalarType (tp: typePtr; modifiers, subscripts: integer);
|
||||||
|
|
||||||
{ Write a scalar type and subscipt field }
|
{ Write a scalar type and subscript field }
|
||||||
{ }
|
{ }
|
||||||
{ parameters: }
|
{ parameters: }
|
||||||
{ tp - type pointer }
|
{ tp - type pointer }
|
||||||
|
@ -1539,7 +1539,7 @@ var
|
||||||
lPtr,tPtr: typePtr; {for tracing forward declared types}
|
lPtr,tPtr: typePtr; {for tracing forward declared types}
|
||||||
|
|
||||||
begin {ResolveForwardReference}
|
begin {ResolveForwardReference}
|
||||||
iPtr^.isForwardDeclared := false; {we will succeeed or flag an error...}
|
iPtr^.isForwardDeclared := false; {we will succeed or flag an error...}
|
||||||
tPtr := iPtr^.itype; {skip to the struct/union type}
|
tPtr := iPtr^.itype; {skip to the struct/union type}
|
||||||
lPtr := nil;
|
lPtr := nil;
|
||||||
while tPtr^.kind in [pointerType,arrayType,functionType,definedType] do begin
|
while tPtr^.kind in [pointerType,arrayType,functionType,definedType] do begin
|
||||||
|
|
|
@ -349,7 +349,7 @@ charSym start single character symbols
|
||||||
dc i'0,0,0,0,0,0,0,0' x-rub
|
dc i'0,0,0,0,0,0,0,0' x-rub
|
||||||
end
|
end
|
||||||
|
|
||||||
icp start in comming priority for expression
|
icp start in-coming priority for expression
|
||||||
! assumes notAnOperation = 200
|
! assumes notAnOperation = 200
|
||||||
dc i1'200' ident
|
dc i1'200' ident
|
||||||
dc i1'200' intconst
|
dc i1'200' intconst
|
||||||
|
|
|
@ -35,7 +35,7 @@ var
|
||||||
|
|
||||||
{from EXPRESSION.PAS}
|
{from EXPRESSION.PAS}
|
||||||
{-------------------}
|
{-------------------}
|
||||||
icp: array[tokenEnum] of byte; {in-commong priorities}
|
icp: array[tokenEnum] of byte; {in-coming priorities}
|
||||||
isp: array[tokenEnum] of byte; {in-stack priorities}
|
isp: array[tokenEnum] of byte; {in-stack priorities}
|
||||||
|
|
||||||
{from Charset.pas}
|
{from Charset.pas}
|
||||||
|
|
Loading…
Reference in New Issue