Writing Compilers and Interpreters by Ronald Mak

Writing Compilers and Interpreters by Ronald Mak

Author:Ronald Mak [Mak, Ronald]
Language: eng
Format: epub
Publisher: Wiley Publishing, Inc.
Published: 2011-03-05T22:00:00+00:00


if (isDeclared) {

formalParms =

(ArrayList<SymTabEntry>) pfId.getAttribute(ROUTINE_PARMS);

parmCount = formalParms != null ? formalParms.size() : 0;

}

if (token.getType() != LEFT_PAREN) {

if (parmCount != 0) {

errorHandler.flag(token, WRONG_NUMBER_OF_PARMS, this);

}

return null;

}

token = nextToken(); // consume opening (

// Loop to parse each actual parameter.

while (token.getType() != RIGHT_PAREN) {

ICodeNode actualNode = expressionParser.parse(token);

// Declared procedure or function: Check the number of actual

// parameters, and check each actual parameter against the

// corresponding formal parameter.

if (isDeclared) {

if (++parmIndex < parmCount) {

SymTabEntry formalId = formalParms.get(parmIndex);

checkActualParameter(token, formalId, actualNode);

}

else if (parmIndex == parmCount) {

errorHandler.flag(token, WRONG_NUMBER_OF_PARMS, this);

}

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.