Exemplo n.º 1
0
		protected override void TranslateSwitchStatementUnsafeBlotchy(List<string> output, SwitchStatementUnsafeBlotchy switchStatement)
		{
			string lookupName = switchStatement.LookupTableName;
			string varName = "switch_key_" + this.GetNextInt();

			if (switchStatement.UsesStrings)
			{
				output.Add(this.CurrentTabIndention);
				output.Add(varName);
				output.Add(" = ");
				output.Add("v_" + lookupName);
				output.Add(".get(");
				this.TranslateExpression(output, switchStatement.Condition);
				output.Add(", " + switchStatement.DefaultCaseId);
				output.Add(")\r\n");
			}
			else
			{
				output.Add(this.CurrentTabIndention);
				output.Add(varName);
				output.Add(" = ");
				output.Add("v_" + lookupName);
				output.Add("[");
				this.TranslateExpression(output, switchStatement.Condition);
				output.Add("]\r\n");
			}

			this.GenerateSearchTree(output, switchStatement.GenerateSearchTree(), varName);
		}
Exemplo n.º 2
0
		protected override void TranslateSwitchStatementUnsafeBlotchy(List<string> output, SwitchStatementUnsafeBlotchy switchStatement)
		{
			this.TranslateSwitchStatement(output, switchStatement.OriginalSwitchStatement);
		}
Exemplo n.º 3
0
		protected abstract void TranslateSwitchStatementUnsafeBlotchy(List<string> output, SwitchStatementUnsafeBlotchy switchStatement);