peterxu422 wrote
On page 208 of the textbook, in Program Structure, class: 'class' className '{' classVarDec* subroutineDec* '}'
why is it subroutineDec* as opposed to subroutineDec+ ? Shouldn't there be at least one function defined in a class in Jack?
It's a simplification to make Jack parsing easier. Properly dealing with "one or more" is a lot harder in a recursive decent parser than "zero or more".
Or maybe it's because "x+" isn't in the grammar language's grammar (10.2.1). 8-)
--Mark