/// <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>
 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();
 }
Пример #2
0
 public Statement(Parser yyp, StateChange sc) : base((yyp))
 {
     kids.Add(sc);
 }