示例#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);
		}
		protected override void TranslateSwitchStatementUnsafeBlotchy(List<string> output, SwitchStatementUnsafeBlotchy switchStatement)
		{
			this.TranslateSwitchStatement(output, switchStatement.OriginalSwitchStatement);
		}
示例#3
0
		protected abstract void TranslateSwitchStatementUnsafeBlotchy(List<string> output, SwitchStatementUnsafeBlotchy switchStatement);