/// <summary>
 /// Loads the plugin settings
 /// </summary>
 public void LoadSettings()
 {
     settingObject = new AS3Settings();
     if (!File.Exists(this.settingFilename))
     {
         this.SaveSettings();
     }
     else
     {
         Object obj = ObjectSerializer.Deserialize(this.settingFilename, settingObject);
         settingObject = (AS3Settings)obj;
     }
     if (settingObject.AS3ClassPath == null)
     {
         settingObject.AS3ClassPath = @"Library\AS3\intrinsic";
     }
     if (settingObject.FlexSDK == null || settingObject.FlexSDK == String.Empty)
     {
         String includedSDK = Path.Combine(PathHelper.ToolDir, "flexsdk");
         if (Directory.Exists(includedSDK))
         {
             settingObject.FlexSDK = includedSDK;
         }
     }
     settingObject.OnClasspathChanged += SettingObjectOnClasspathChanged;
 }
Exemple #2
0
 /// <summary>
 /// Loads the plugin settings
 /// </summary>
 public void LoadSettings()
 {
     settingObject = new AS3Settings();
     if (!File.Exists(this.settingFilename))
     {
         this.SaveSettings();
     }
     else
     {
         Object obj = ObjectSerializer.Deserialize(this.settingFilename, settingObject);
         settingObject = (AS3Settings)obj;
     }
     if (settingObject.AS3ClassPath == null)
     {
         settingObject.AS3ClassPath = @"Library\AS3\intrinsic";
     }
 }
Exemple #3
0
        static void Main(string[] args)
        {
            ExtractManifests();
            //return;

            // AS3 doc parsing
            string AS3XML = "ActionsPanel_3.xml";
            if (!File.Exists(AS3XML))
            {
                Console.WriteLine("Error: missing {0}, copy this file from Flash CS4 installation", AS3XML);
                return;
            }
            ExtractXML(AS3XML);

            // SWC parsing
            Console.WriteLine("Parsing SWCs...");
            AS3Settings settings = new AS3Settings();
            context = new Context(settings);
            context.Classpath = new List<PathModel>();
            context.Classpath.Add(ParseSWC("libs\\player\\9\\playerglobal.swc"));
            context.Classpath.Add(ParseSWC("libs\\player\\10\\playerglobal.swc"));
            context.Classpath.Add(ParseSWC("libs\\player\\10.1\\playerglobal.swc"));
            context.Classpath.Add(ParseSWC("libs\\air\\servicemonitor.swc"));
            context.Classpath.Add(ParseSWC("libs\\air\\airglobal.swc"));
            context.Classpath.Add(ParseSWC("libs\\air\\applicationupdater.swc"));
            context.Classpath.Add(ParseSWC("libs\\air\\applicationupdater_ui.swc"));
            context.Classpath.Add(ParseSWC("libs\\air\\airframework.swc"));

            // Intrinsics generation
            Console.WriteLine("Generating intrinsics...");
            generated = new Dictionary<string, string>();
            GenerateIntrinsics("FP9", context.Classpath[0], false, false);
            GenerateIntrinsics("FP10", context.Classpath[1], false, true);
            GenerateIntrinsics("FP10.1", context.Classpath[2], false, true);
            GenerateIntrinsics("AIR", context.Classpath[3], true, true);
            GenerateIntrinsics("AIR", context.Classpath[4], true, true);
            GenerateIntrinsics("AIR", context.Classpath[5], true, true);
            GenerateIntrinsics("AIR", context.Classpath[6], true, true);
            GenerateIntrinsics("AIRFlex3", context.Classpath[7], true, true);

            Console.WriteLine("Done.");
        }
Exemple #4
0
        public Context(AS3Settings initSettings)
        {
            as3settings = initSettings;

            /* AS-LIKE OPTIONS */

            hasLevels = false;
            docType   = "flash.display.MovieClip";

            /* DESCRIBE LANGUAGE FEATURES */

            mxmlEnabled = true;

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

            // allowed declarations access modifiers
            Visibility all = Visibility.Public | Visibility.Internal | Visibility.Protected | Visibility.Private;

            features.classModifiers  = all;
            features.varModifiers    = all;
            features.constModifiers  = all;
            features.methodModifiers = all;

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

            // keywords
            features.dot          = ".";
            features.voidKey      = "void";
            features.objectKey    = "Object";
            features.booleanKey   = "Boolean";
            features.numberKey    = "Number";
            features.arrayKey     = "Array";
            features.importKey    = "import";
            features.typesPreKeys = new string[] { "import", "new", "typeof", "is", "as", "extends", "implements" };
            features.codeKeywords = new string[] {
                "class", "interface", "var", "function", "const", "new", "delete", "typeof", "is", "as", "return",
                "break", "continue", "if", "else", "for", "each", "in", "while", "do", "switch", "case", "default", "with",
                "null", "true", "false", "try", "catch", "finally", "throw", "use", "namespace"
            };
            features.varKey       = "var";
            features.constKey     = "const";
            features.functionKey  = "function";
            features.getKey       = "get";
            features.setKey       = "set";
            features.staticKey    = "static";
            features.finalKey     = "final";
            features.overrideKey  = "override";
            features.publicKey    = "public";
            features.internalKey  = "internal";
            features.protectedKey = "protected";
            features.privateKey   = "private";
            features.intrinsicKey = "extern";
            features.namespaceKey = "namespace";

            /* INITIALIZATION */

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

            // live syntax checking
            timerCheck = new Timer(500);
            timerCheck.SynchronizingObject = PluginBase.MainForm as System.Windows.Forms.Form;
            timerCheck.AutoReset           = false;
            timerCheck.Elapsed            += new ElapsedEventHandler(timerCheck_Elapsed);
            FlexShells.SyntaxError        += new SyntaxErrorHandler(FlexShell_SyntaxError);
        }
Exemple #5
0
 /// <summary>
 /// Loads the plugin settings
 /// </summary>
 public void LoadSettings()
 {
     settingObject = new AS3Settings();
     if (!File.Exists(this.settingFilename)) this.SaveSettings();
     else
     {
         Object obj = ObjectSerializer.Deserialize(this.settingFilename, settingObject);
         settingObject = (AS3Settings)obj;
     }
     if (settingObject.AS3ClassPath == null) settingObject.AS3ClassPath = @"Library\AS3\intrinsic";
     if (settingObject.FlexSDK == null || settingObject.FlexSDK == String.Empty)
     {
         String includedSDK = Path.Combine(PathHelper.ToolDir, "flexsdk");
         if (Directory.Exists(includedSDK)) settingObject.FlexSDK = includedSDK;
     }
     settingObject.OnClasspathChanged += SettingObjectOnClasspathChanged;
 }
Exemple #6
0
        public Context(AS3Settings initSettings)
        {
            as3settings = initSettings;

            /* AS-LIKE OPTIONS */

            hasLevels = false;
            docType = "flash.display.MovieClip";

            /* DESCRIBE LANGUAGE FEATURES */

            mxmlEnabled = true;

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

            // allowed declarations access modifiers
            Visibility all = Visibility.Public | Visibility.Internal | Visibility.Protected | Visibility.Private;
            features.classModifiers = all;
            features.varModifiers = all;
            features.constModifiers = all;
            features.methodModifiers = all;

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

            // keywords
            features.dot = ".";
            features.voidKey = "void";
            features.objectKey = "Object";
            features.booleanKey = "Boolean";
            features.numberKey = "Number";
            features.arrayKey = "Array";
            features.importKey = "import";
            features.typesPreKeys = new string[] { "import", "new", "typeof", "is", "as", "extends", "implements" };
            features.codeKeywords = new string[] {
                "class", "interface", "var", "function", "const", "new", "delete", "typeof", "is", "as", "return",
                "break", "continue", "if", "else", "for", "each", "in", "while", "do", "switch", "case", "default", "with",
                "null", "true", "false", "try", "catch", "finally", "throw", "use", "namespace"
            };
            features.varKey = "var";
            features.constKey = "const";
            features.functionKey = "function";
            features.getKey = "get";
            features.setKey = "set";
            features.staticKey = "static";
            features.finalKey = "final";
            features.overrideKey = "override";
            features.publicKey = "public";
            features.internalKey = "internal";
            features.protectedKey = "protected";
            features.privateKey = "private";
            features.intrinsicKey = "extern";
            features.namespaceKey = "namespace";

            /* INITIALIZATION */

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

            // live syntax checking
            timerCheck = new Timer(500);
            timerCheck.SynchronizingObject = PluginBase.MainForm as System.Windows.Forms.Form;
            timerCheck.AutoReset = false;
            timerCheck.Elapsed += new ElapsedEventHandler(timerCheck_Elapsed);
            FlexShells.SyntaxError += new SyntaxErrorHandler(FlexShell_SyntaxError);
        }
 /// <summary>
 /// Loads the plugin settings
 /// </summary>
 public void LoadSettings()
 {
     settingObject = new AS3Settings();
     if (!File.Exists(this.settingFilename)) this.SaveSettings();
     else
     {
         Object obj = ObjectSerializer.Deserialize(this.settingFilename, settingObject);
         settingObject = (AS3Settings)obj;
     }
     if (settingObject.AS3ClassPath == null) settingObject.AS3ClassPath = @"Library\AS3\intrinsic";
 }