/// <summary> /// Generates the code for a StateChange node. /// </summary> /// <param name="sc">The StateChange node.</param> /// <returns>String containing C# code for StateChange sc.</returns> private string GenerateStateChange(StateChange sc) { //State is in the LSL_Api because it requires a ref to the ScriptEngine, which we can't have in the ScriptBase StringBuilder retVal = new StringBuilder(); retVal.Append(GenerateLine("try", null)); retVal.Append(GenerateLine("{", null)); retVal.Append(Generate( String.Format("((dynamic)m_apis[\"ll\"]).state(\"{0}\");", sc.NewState) , sc)); retVal.Append(GenerateLine("}", null)); retVal.Append(GenerateLine("catch", null)); retVal.Append(GenerateLine("{", null)); retVal.Append(GenerateLine("yield break;", null)); retVal.Append(GenerateLine("}", null)); return retVal.ToString(); }
public Statement(Parser yyp, StateChange sc) : base((yyp)) { kids.Add(sc); }