public object VisitTermAST([NotNull] TermASTContext context) { Visit(context.factor(0)); for (int i = 1; i < context.factor().Length; i++) { Visit(context.factor(i)); string instruction = "BINARY_"; if (context.mulop(i - 1).GetText() == "*") { instruction += "MULTIPLY"; } else if (context.mulop(i - 1).GetText() == "/") { instruction += "DIVIDE"; } AddLine(instruction); } return(null); }