Ejemplo n.º 1
0
 public virtual void VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)
 {
     if (this.ThrowException)
     {
         throw (System.Exception) this.CreateException(gotoDefaultStatement);
     }
 }
Ejemplo n.º 2
0
 public virtual void VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)
 {
     if (ThrowException)
     {
         throw (Exception)CreateException(gotoDefaultStatement);
     }
 }
Ejemplo n.º 3
0
        protected override void DoEmit()
        {
            AstNode node = null;

            if (GotoStatement != null)
            {
                node = Emitter.AsyncBlock.AwaitExpressions.First(expr => expr is LabelStatement && ((LabelStatement)expr).Label == GotoStatement.Label);
            }
            else if (GotoCaseStatement != null)
            {
                var switchStatement = GotoCaseStatement.GetParent <SwitchStatement>();
                var rr = Emitter.Resolver.ResolveNode(GotoCaseStatement.LabelExpression);

                node = switchStatement.SwitchSections.First(ss => ss.CaseLabels.Any(cl =>
                {
                    if (cl.Expression.IsNull)
                    {
                        return(false);
                    }

                    var caseLabel_rr = Emitter.Resolver.ResolveNode(cl.Expression);

                    if (caseLabel_rr.ConstantValue is string)
                    {
                        return(caseLabel_rr.ConstantValue.Equals(rr.ConstantValue));
                    }

                    return(System.Convert.ToInt64(caseLabel_rr.ConstantValue) == System.Convert.ToInt64(rr.ConstantValue));
                }));
            }
            else if (GotoDefaultStatement != null)
            {
                var switchStatement = GotoDefaultStatement.GetParent <SwitchStatement>();
                node = switchStatement.SwitchSections.First(ss => ss.CaseLabels.Any(cl => cl.Expression.IsNull));
            }

            var hashcode = node.GetHashCode();

            Emitter.AsyncBlock.JumpLabels.Add(new AsyncJumpLabel
            {
                Node   = node,
                Output = Emitter.Output
            });
            Write(JS.Vars.ASYNC_STEP + " = " + Helpers.PrefixDollar("{", hashcode, "};"));
            WriteNewLine();
            Write("continue;");
        }
Ejemplo n.º 4
0
 public RedILNode VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement, State data)
 {
     throw new System.NotImplementedException();
 }
		public virtual void VisitGotoDefaultStatement (GotoDefaultStatement gotoDefaultStatement)
		{
			VisitChildren (gotoDefaultStatement);
		}
Ejemplo n.º 6
0
 public override ControlFlowNode VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement, ControlFlowNode data)
 {
     gotoCaseOrDefault.Add(data);
     return(builder.CreateEndNode(gotoDefaultStatement));
 }
Ejemplo n.º 7
0
 public void VisitGotoDefaultStatement(GotoDefaultStatement node)
 {
     NotSupported(node);
 }
Ejemplo n.º 8
0
 public override void VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)
 {
     Found = true;
 }
Ejemplo n.º 9
0
 public override void VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)
 {
     new GotoBlock(this, gotoDefaultStatement).Emit();
 }
Ejemplo n.º 10
0
		public virtual void VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)
		{
			StartNode(gotoDefaultStatement);
			DebugStart(gotoDefaultStatement);
			WriteKeyword(GotoDefaultStatement.GotoKeywordRole);
			WriteKeyword(GotoDefaultStatement.DefaultKeywordRole);
			SemicolonDebugEnd(gotoDefaultStatement);
			EndNode(gotoDefaultStatement);
		}
Ejemplo n.º 11
0
		public virtual void VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)
		{
			StartNode(gotoDefaultStatement);
			DebugStart(gotoDefaultStatement);
			WriteKeywordReferences(GotoDefaultStatement.GotoKeywordRole, GotoDefaultStatement.DefaultKeywordRole, currentSwitchReference);
			SemicolonDebugEnd(gotoDefaultStatement);
			EndNode(gotoDefaultStatement);
		}
Ejemplo n.º 12
0
 public Node VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)
 {
     return(CreateDummy(gotoDefaultStatement));
 }
Ejemplo n.º 13
0
 public UnifiedElement VisitGotoDefaultStatement(
     GotoDefaultStatement gotoDefaultStatement, object data)
 {
     return(UnifiedGoto.Create(UnifiedCase.CreateDefault()));
 }
 public override void VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)
 {
     _errorReporter.Message(7998, gotoDefaultStatement.GetRegion(), "goto default");
     _result = false;
 }
Ejemplo n.º 15
0
        public void VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)
        {
            JsonObject statement = CreateJsonStatement(gotoDefaultStatement);
            AddKeyword(statement, GotoDefaultStatement.GotoKeywordRole);
            AddKeyword(statement, "default-keyword", GotoDefaultStatement.DefaultKeywordRole);
            Push(statement);
            throw new FirstTimeUseException();

        }
 public virtual S VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement, T data)
 {
     return(VisitChildren(gotoDefaultStatement, data));
 }
 public override void VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)
 {
     throw NotSupportedToConsistency();
 }
Ejemplo n.º 18
0
 public override void VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)
 {
     this.Add(gotoDefaultStatement);
     base.VisitGotoDefaultStatement(gotoDefaultStatement);
 }
 /// <inheritdoc/>
 public virtual void VisitGotoDefaultStatement(GotoDefaultStatement syntax)
 {
     VisitNode(syntax);
 }
Ejemplo n.º 20
0
 public void VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 21
0
 public StringBuilder VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement, int data)
 {
     throw new SLSharpException("SL# cannot jump from one case to another.");
 }
 public virtual void VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)
 {
     if (this.ThrowException)
     {
         throw (Exception)this.CreateException(gotoDefaultStatement);
     }
 }
Ejemplo n.º 23
0
 public GotoBlock(IEmitter emitter, GotoDefaultStatement gotoDefaultStatement) : base(emitter, gotoDefaultStatement)
 {
     GotoDefaultStatement = gotoDefaultStatement;
 }
		public override void VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement) {
			_result.Add(JsStatement.Goto(_currentGotoCaseMap[_gotoCaseMapDefaultKey]));
		}
 public override void VisitGotoDefaultStatement(GotoDefaultStatement syntax)
 {
     _underlyingVisitor.VisitGotoDefaultStatement(syntax);
 }
Ejemplo n.º 26
0
 public StringBuilder VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement, int data)
 {
     throw new ASLException("ASL cannot jump from one case to another.");
 }
Ejemplo n.º 27
0
        protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
        {
            GotoDefaultStatement o = other as GotoDefaultStatement;

            return(o != null);
        }
Ejemplo n.º 28
0
 public StringBuilder VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)
 {
     throw new NotImplementedException();
 }
			public override void VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement) {
				HandleGoto(_gotoCaseMapDefaultKey);
			}
Ejemplo n.º 30
0
 public JNode VisitGotoDefaultStatement(GotoDefaultStatement node)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 31
0
			public override object Visit(GotoDefault gotoDefault)
			{
				var result = new GotoDefaultStatement();
				result.AddChild(new CSharpTokenNode(Convert(gotoDefault.loc), GotoDefaultStatement.GotoKeywordRole), GotoDefaultStatement.GotoKeywordRole);
				var location = LocationsBag.GetLocations(gotoDefault);
				if (location != null) {
					result.AddChild(new CSharpTokenNode(Convert(location [0]), GotoDefaultStatement.DefaultKeywordRole), GotoDefaultStatement.DefaultKeywordRole);
					if (location.Count > 1)
						result.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Semicolon), Roles.Semicolon);
				}
				
				return result;
			}
Ejemplo n.º 32
0
 public override void VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)
 {
     this.AwaitExpressions.Add(new Tuple <int, AstNode>(this.InvocationLevel, gotoDefaultStatement));
     base.VisitGotoDefaultStatement(gotoDefaultStatement);
 }
Ejemplo n.º 33
0
		public void VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)
		{
			StartNode(gotoDefaultStatement);
			WriteKeyword(GotoDefaultStatement.GotoKeywordRole);
			WriteKeyword(GotoDefaultStatement.DefaultKeywordRole);
			Semicolon();
			EndNode(gotoDefaultStatement);
		}
Ejemplo n.º 34
0
 public virtual Node VisitGotoDefaultStatement(GotoDefaultStatement gotoDefaultStatement)
 {
     throw new System.NotImplementedException();
 }