Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ProcedureDefinition :
- sIdentifier oSymbolStkPushLocalIdentifier % procedure name
- [ oSymbolStkChooseKind
- | syUndefined:
- | syExternal:
- % Program parameters must be declared as file variables
- #eExternalDeclare
- | *:
- #eMultiplyDefined
- % New definition obscures old one.
- ]
- %%%%%%%%%%% ADDED
- [
- | sPublic:
- oSymbolStkSetKind(syPublicProcedure)
- | *:
- oSymbolStkSetKind(syProcedure)
- ]
- %%%%%%%%%%%
- .tSkipProc % Branch around the procedure definition
- oFixPushForwardBranch
- oEmitNullAddress
- %%%%%%%%%%% DELETED
- % oSymbolStkSetKind(syProcedure)
- %%%%%%%%%%%
- oSymbolStkEnterCodeAddress
- oTypeStkPush(tpNull)
- oTypeStkSetRecursionFlag(yes)
- oTypeTblEnter
- oSymbolStkEnterTypeReference
- oSymbolTblEnter
- oSymbolTblPushScope % procedure scope
- @ProcedureHeading
- %%%%%%%%%%% CHANGED 858
- % @Block
- %%%%%%%%%%%
- % If there is a return type, it is a function
- [
- | sIdentifier:
- [ oSymbolStkChooseKind % of this procedure
- | syProcedure:
- oSymbolStkSetKind(syFunction)
- | syPublicProcedure:
- oSymbolStkSetKind(syPublicFunction)
- ]
- % Process the return type identifier we just accepted
- @FunctionReturnType
- @Block
- % Every function ends with a return statement
- sReturn
- @FunctionReturnValue
- | *:
- @Block
- ]
- %%%%%%%%%%%
- .tProcedureEnd
- oFixPopForwardBranch % fix skip around procedure
- oSymbolTblUpdate
- oSymbolStkPop
- oTypeStkSetRecursionFlag(no)
- oTypeTblUpdate
- oTypeStkPop
- oSymbolTblPopScope;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement