className: identifier subroutineName: identifier class: 'class' className '{' classVarDec* subroutineDec* '}' classVarDec: ('static' | 'field') type varName (',' varName)* ';' subroutineDec: ('constructor' | 'function' | 'method') ('void' | type) subroutineName '(' parameterList ')' subroutineBody parameterList: don't worry about this yet subroutineBody: '{' varDec* statements '}' varDec: 'var' type varName (',' varName)* ';' statements: statement* statement: letStatement | ifStatement | whileStatement | doStatement | returnStatement doStatement: 'do' subroutineCall ';' expression: term (op term)* term: integerConstant | stringConstant | keywordConstant | '(' expression ')' | unaryOp term | varName | varName '[' expression ']' | subroutineCall subroutineCall: subroutineName '(' expressionList ')' | (className | varName) '.' subroutineName '(' ... ')' Main.main(blah) -- calling a 'function' f.foo(bar) -- calling the 'method' foo on the object f foo(bar) -- calling function/method within -- current class ----------------------------------------------------