コード例 #1
0
ファイル: MakeClass.cs プロジェクト: tiesont/CSharpEval
 private void Crosslink()
 {
     try {
         InputList.CrosslinkBrackets();
     } catch (Exception ex) {
         InputList.ThrowException(ex.Message);
     }
 }
コード例 #2
0
ファイル: MakeClass.cs プロジェクト: tiesont/CSharpEval
 private bool IsAFieldDefinition()
 {
     for (int i = InputList.Index; i < InputList.Count; i++)
     {
         if (InputList[i].Str == "(")
         {
             return(false);
         }
         if (InputList[i].Str == ";")
         {
             return(true);
         }
     }
     InputList.ThrowException("Expected a field definition (with no initialisation) or a method here.");
     return(false);
 }
コード例 #3
0
ファイル: MakeClass.cs プロジェクト: tiesont/CSharpEval
        private void AddMethodToDictionary(CompileMethod cm, bool overwriteAllowed)
        {
            CompileMethod existing = null;

            if (CompileMethodsDict.TryGetValue(cm.MethodName, out existing))
            {
                if (!overwriteAllowed)
                {
                    InputList.ThrowException("The method '" + cm.MethodName + "' already exists.");
                }
                if (cm.MethodName != DoExpressionName && existing.MethodDelegateType != cm.MethodDelegateType)
                {
                    InputList.ThrowException("Trying to replace the method '" + cm.MethodName + "', however its signature does not exactly match the existing method.");
                }
                cm.Index = existing.Index;
            }
            else
            {
                cm.Index = CompileMethodsDict.Count;
            }
            CompileMethodsDict[cm.MethodName] = cm;
        }