예제 #1
0
 public void CopyFrom(FunctionData other)
 {
     m_Call = other.m_Call;
     m_Statements = other.m_Statements;
     m_ExtentClass = other.m_ExtentClass;
 }
예제 #2
0
 public void AddStatement(CallData statement)
 {
     m_Statements.Add(statement);
     if ((int)ExtentClassEnum.EXTENT_CLASS_STATEMENT != m_ExtentClass)
     {
         m_ExtentClass = (int)ExtentClassEnum.EXTENT_CLASS_STATEMENT;
     }
 }
예제 #3
0
 public void Clear()
 {
     m_Call = null;
     m_Statements = new List<ISyntaxComponent>();
     m_ExtentClass = (int)ExtentClassEnum.EXTENT_CLASS_NOTHING;
 }
예제 #4
0
 public void CopyFrom(CallData other)
 {
     m_IsHighOrder = other.m_IsHighOrder;
     m_Name = other.m_Name;
     m_Call = other.m_Call;
     m_Params = other.m_Params;
     m_ParamClass = other.m_ParamClass;
 }
예제 #5
0
 public void Clear()
 {
     m_Name = null;
     m_Call = null;
     m_IsHighOrder = false;
     m_Params = new List<ISyntaxComponent>();
     m_ParamClass = (int)ParamClassEnum.PARAM_CLASS_NOTHING;
 }
예제 #6
0
 public void AddParams(CallData param)
 {
     m_Params.Add(param);
     if ((int)ParamClassEnum.PARAM_CLASS_NOTHING == m_ParamClass)
     {
         m_ParamClass = (int)ParamClassEnum.PARAM_CLASS_PARENTHESIS;
     }
 }
예제 #7
0
 public static string getCallString(CallData data)
 {
     #if FULL_VERSION
     string lineNo = "";//formatString("/* %d */",data.GetLine());
     string line = "";
     if (data.IsHighOrder)
     {
         line = getCallString(data.Call);
     }
     else if (data.HaveId())
     {
         line = quoteString(data.GetId(), data.GetIdType());
     }
     if (data.HaveParam())
     {
         int paramClass = data.GetParamClass();
         if ((int)CallData.ParamClassEnum.PARAM_CLASS_OPERATOR == paramClass)
         {
             switch (data.GetParamNum())
             {
                 case 1:
                     return string.Format("{0} {1}", line, data.GetParam(0).ToScriptString());
                 case 2:
                     return string.Format("{0} {1} {2}", data.GetParam(0).ToScriptString(), line, data.GetParam(1).ToScriptString());
                 default:
                     return line;
             }
         }
         else
         {
             string lbracket = "";
             string rbracket = "";
             switch (paramClass)
             {
                 case (int)CallData.ParamClassEnum.PARAM_CLASS_PARENTHESIS:
                     lbracket = "(";
                     rbracket = ")";
                     break;
                 case (int)CallData.ParamClassEnum.PARAM_CLASS_BRACKET:
                     lbracket = "[";
                     rbracket = "]";
                     break;
                 case (int)CallData.ParamClassEnum.PARAM_CLASS_PERIOD:
                     lbracket = ".";
                     rbracket = "";
                     break;
                 case (int)CallData.ParamClassEnum.PARAM_CLASS_PERIOD_PARENTHESIS:
                     lbracket = ".(";
                     rbracket = ")";
                     break;
                 case (int)CallData.ParamClassEnum.PARAM_CLASS_PERIOD_BRACKET:
                     lbracket = ".[";
                     rbracket = "]";
                     break;
                 case (int)CallData.ParamClassEnum.PARAM_CLASS_PERIOD_BRACE:
                     lbracket = ".{";
                     rbracket = "}";
                     break;
             }
             StringBuilder stream = new StringBuilder();
             stream.Append(lbracket);
             int ct = data.GetParamNum();
             for (int i = 0; i < ct; ++i)
             {
                 if (i > 0)
                     stream.Append(",");
                 ISyntaxComponent param = data.GetParam(i);
                 if ((int)CallData.ParamClassEnum.PARAM_CLASS_PERIOD == paramClass)
                     stream.Append(unquoteString(param.ToScriptString()));
                 else
                     stream.Append(param.ToScriptString());
             }
             stream.Append(rbracket);
             return string.Format("{0}{1}{2}", lineNo, line, stream.ToString());
         }
     }
     else
     {
         return string.Format("{0}{1}", lineNo, line);
     }
     #else
     return "";
     #endif
 }
예제 #8
0
 protected virtual void Load(CallData callData)
 {
 }