UNPKG

solidity-antlr4

Version:

Solidity Lang Lexer and Parser by official ANTLR4 grammar

16 lines (15 loc) 441 B
import { BaseNode } from "../base.js"; export class IfStatement extends BaseNode { type = "IfStatement"; condition; ifStatement; elseStatement = null; constructor(ctx, visitor) { super(ctx, visitor); this.condition = ctx.expression().accept(visitor); this.ifStatement = ctx.statement(0).accept(visitor); if (ctx.Else() && ctx.statement(1)) { this.elseStatement = ctx.statement(1).accept(visitor); } } }