Single Pass
void parseStatement() {
case Token.IDENTIFIER:
name = currentToken.spelling;
inScope( name );
acceptIt();
switch( currentToken.kind )
case Token.BECOMES
acceptIt();
lhsType = parseExpression();
rhsType = getIdType( name );
equivTypes( lhsType,rhsType );
plantSTORE( name, rhsType );
break;
x := x + 1;
Previous slide
Next slide
Back to first slide
View graphic version