예제 #1
0
 /// <summary>
 /// Loads the plugin settings
 /// </summary>
 public void LoadSettings()
 {
     this.settingObject = new UnitySettings();
     if (!File.Exists(this.settingFilename))
     {
         this.SaveSettings();
     }
     else
     {
         Object obj = ObjectSerializer.Deserialize(this.settingFilename, this.settingObject);
         this.settingObject = (UnitySettings)obj;
         if (settingObject.InstalledSDKs != null)
         {
             foreach (InstalledSDK sdk in settingObject.InstalledSDKs)
             {
                 sdk.Owner = this;
             }
         }
     }
     if (this.settingObject.UserClasspath == null)
     {
         this.settingObject.UserClasspath = new String[] {};
     }
 }
예제 #2
0
        public Context(UnitySettings initSettings)
        {
            unitysettings = initSettings;

            /* AS-LIKE OPTIONS */

            hasLevels = true;
            docType   = "MonoBehaviour";

            /* DESCRIBE LANGUAGE FEATURES */

            // language constructs
            features.hasPackages          = false;
            features.hasImports           = true;
            features.hasImportsWildcard   = false;
            features.hasClasses           = true;
            features.hasMultipleDefs      = true;
            features.hasExtends           = true;
            features.hasImplements        = true;
            features.hasInterfaces        = true;
            features.hasEnums             = true;
            features.hasGenerics          = true;
            features.hasEcmaTyping        = true;
            features.hasCArrays           = true;
            features.hasDirectives        = true;
            features.hasVars              = true;
            features.hasConsts            = false;
            features.hasMethods           = true;
            features.hasStatics           = true;
            features.hasTryCatch          = true;
            features.hasStaticInheritance = true;
            features.checkFileName        = false;

            // allowed declarations access modifiers
            features.classModifiers  = Visibility.Public | Visibility.Private;
            features.enumModifiers   = Visibility.Public | Visibility.Private;
            features.varModifiers    = Visibility.Public | Visibility.Private;
            features.methodModifiers = Visibility.Public | Visibility.Private;

            // default declarations access modifiers
            features.classModifierDefault  = Visibility.Public;
            features.enumModifierDefault   = Visibility.Public;
            features.varModifierDefault    = Visibility.Public;
            features.methodModifierDefault = Visibility.Public;

            // keywords
            features.dot            = ".";
            features.voidKey        = "void";
            features.objectKey      = "Object";
            features.booleanKey     = "boolean";
            features.numberKey      = "float";
            features.arrayKey       = "Array";
            features.importKey      = "import";
            features.CArrayTemplate = "BuiltInArray";
            features.typesPreKeys   = new string[] { "import", "new", "instanceof", "extends", "implements" };
            features.codeKeywords   = new string[] {
                "class", "interface", "var", "function", "new", "delete", "instanceof", "return", "break", "continue",
                "if", "else", "for", "in", "while", "do", "switch", "case", "default", "with",
                "null", "undefined", "true", "false", "try", "catch", "finally", "throw"
            };
            features.varKey       = "var";
            features.functionKey  = "function";
            features.getKey       = "get";
            features.setKey       = "set";
            features.staticKey    = "static";
            features.overrideKey  = "override";
            features.publicKey    = "public";
            features.privateKey   = "private";
            features.intrinsicKey = "intrinsic";

            features.functionArguments = new MemberModel("arguments", "FunctionArguments", FlagType.Variable | FlagType.LocalVar, 0);

            /* INITIALIZATION */

            settings = initSettings;
            //BuildClassPath(); // defered to first use
        }
예제 #3
0
 /// <summary>
 /// Loads the plugin settings
 /// </summary>
 public void LoadSettings()
 {
     this.settingObject = new UnitySettings();
     if (!File.Exists(this.settingFilename)) this.SaveSettings();
     else
     {
         Object obj = ObjectSerializer.Deserialize(this.settingFilename, this.settingObject);
         this.settingObject = (UnitySettings)obj;
         if (settingObject.InstalledSDKs != null)
             foreach (InstalledSDK sdk in settingObject.InstalledSDKs)
                 sdk.Owner = this;
     }
     if (this.settingObject.UserClasspath == null)
     {
         this.settingObject.UserClasspath = new String[] {};
     }
 }
예제 #4
0
        public Context(UnitySettings initSettings)
        {
            unitysettings = initSettings;

            /* AS-LIKE OPTIONS */

            hasLevels = true;
            docType = "MonoBehaviour";

            /* DESCRIBE LANGUAGE FEATURES */

            // language constructs
            features.hasPackages = false;
            features.hasImports = true;
            features.hasImportsWildcard = false;
            features.hasClasses = true;
            features.hasMultipleDefs = true;
            features.hasExtends = true;
            features.hasImplements = true;
            features.hasInterfaces = true;
            features.hasEnums = true;
            features.hasGenerics = true;
            features.hasEcmaTyping = true;
            features.hasCArrays = true;
            features.hasDirectives = true;
            features.hasVars = true;
            features.hasConsts = false;
            features.hasMethods = true;
            features.hasStatics = true;
            features.hasTryCatch = true;
            features.hasStaticInheritance = true;
            features.checkFileName = false;

            // allowed declarations access modifiers
            features.classModifiers = Visibility.Public | Visibility.Private;
            features.enumModifiers = Visibility.Public | Visibility.Private;
            features.varModifiers = Visibility.Public | Visibility.Private;
            features.methodModifiers = Visibility.Public | Visibility.Private;

            // default declarations access modifiers
            features.classModifierDefault = Visibility.Public;
            features.enumModifierDefault = Visibility.Public;
            features.varModifierDefault = Visibility.Public;
            features.methodModifierDefault = Visibility.Public;

            // keywords
            features.dot = ".";
            features.voidKey = "void";
            features.objectKey = "Object";
            features.booleanKey = "boolean";
            features.numberKey = "float";
            features.arrayKey = "Array";
            features.importKey = "import";
            features.CArrayTemplate = "BuiltInArray";
            features.typesPreKeys = new string[] { "import", "new", "instanceof", "extends", "implements" };
            features.codeKeywords = new string[] {
                "class", "interface", "var", "function", "new", "delete", "instanceof", "return", "break", "continue",
                "if", "else", "for", "in", "while", "do", "switch", "case", "default", "with",
                "null", "undefined", "true", "false", "try", "catch", "finally", "throw"
            };
            features.varKey = "var";
            features.functionKey = "function";
            features.getKey = "get";
            features.setKey = "set";
            features.staticKey = "static";
            features.overrideKey = "override";
            features.publicKey = "public";
            features.privateKey = "private";
            features.intrinsicKey = "intrinsic";

            features.functionArguments = new MemberModel("arguments", "FunctionArguments", FlagType.Variable | FlagType.LocalVar, 0);

            /* INITIALIZATION */

            settings = initSettings;
            //BuildClassPath(); // defered to first use
        }