solidity-antlr4
Version:
Solidity Lang Lexer and Parser by official ANTLR4 grammar
25 lines (24 loc) • 917 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.UnarySuffixOperation = exports.UnaryPrefixOperation = exports.UnaryOperation = void 0;
var _antlr = require("../../antlr4/index.cjs");
var _base = require("../base.cjs");
class UnaryOperation extends _base.BaseNode {
type = "UnaryOperation";
operator = null;
left = null;
right = null;
constructor(ctx, visitor) {
super(ctx, visitor);
if (ctx instanceof _antlr.UnaryPrefixOperationContext) {
this.operator = ctx.getChild(0)?.getText() ?? null;
this.right = ctx.getChild(1)?.accept(visitor) ?? null;
} else if (ctx instanceof _antlr.UnarySuffixOperationContext) {
this.left = ctx.getChild(0)?.accept(visitor) ?? null;
this.operator = ctx.getChild(1)?.getText() ?? null;
}
}
}
exports.UnarySuffixOperation = exports.UnaryPrefixOperation = exports.UnaryOperation = UnaryOperation;