public override void ExitSwitchstatement([NotNull] CPPLINTParser.SwitchstatementContext context) { var state = _stateStack.Pop(); switch (state.Type) { case StateType.FallThrough: case StateType.Switch: FallThroughError(state.Token); break; case StateType.NoStatement: case StateType.Break: break; case StateType.Iteration: case StateType.IfElse: default: throw new InvalidOperationException(); } }
public override void EnterSwitchstatement([NotNull] CPPLINTParser.SwitchstatementContext context) { _stateStack.Push(new State { Type = StateType.Switch, Token = context.Switch().Symbol }); }