IGNORE: "[ ]";
LINE_END: "[\n]";

INTEGER: "[0-9]+";
IDENTIFIER: "[a-zA-Z_][a-zA-Z0-9_]*";

ADD_OPER: "[+-]";
MUL_OPER: "[*]";

main: line* statement LINE_END? [EOF];

line: statement LINE_END;

statement: expr;

expr: assignment |
      arg;

assignment: lhs "=" rhs;

lhs: IDENTIFIER;

rhs: arg;

arg: additive;

additive: multitive ADD_OPER additive | multitive;
multitive: primary MUL_OPER multitive | primary;

primary: "(" expr ")" |
         IDENTIFIER |
         send |
         literal;

send: operation send_args;

operation: IDENTIFIER;

send_args: args;

args: arg "," args | arg;

literal: INTEGER;
IGNORE: "[ ]";
LINE_END: "[\n]";

INTEGER: "[0-9]+";
IDENTIFIER: "[a-zA-Z_][a-zA-Z0-9_]*";

ADD_OPER: "[+-]";
MUL_OPER: "[*]";

main: line* statement? LINE_END? [EOF];

line: statement LINE_END | LINE_END;

statement: expr;

expr: assignment |
      arg;

assignment: lhs "=" rhs;

lhs: IDENTIFIER;

rhs: arg;

arg: additive;

additive: multitive ADD_OPER additive | multitive;
multitive: primary MUL_OPER multitive | primary;

primary: "(" expr ")" |
         IDENTIFIER |
         send |
         literal;

send: operation send_args;

operation: IDENTIFIER;

send_args: args;

args: arg "," args | arg;

literal: INTEGER;

Make sure we parse everything
Make sure we parse everything
