static public void Parse(PathModel path, Context context) { LibParser inst = new LibParser(path, context); inst.Run(); }
public LibParser(PathModel path, Context context) { this.path = path; this.context = context; }
/// <summary> /// Handles the incoming events /// </summary> public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority) { switch (e.Type) { case EventType.ProcessArgs: /*TextEvent te = e as TextEvent; if (te.Value.IndexOf("$(FlexSDK)") >= 0) { te.Value = te.Value.Replace("$(FlexSDK)", contextInstance.GetCompilerPath()); }*/ break; case EventType.Command: DataEvent de = e as DataEvent; string action = de.Action; if (PluginBase.CurrentProject == null || !(PluginBase.CurrentProject is LoomProject)) { if (action == "ProjectManager.Project") LoomHelper.Monitor(null); return; } if (action == "ProjectManager.OpenVirtualFile") { if (PluginBase.CurrentProject != null && PluginBase.CurrentProject.Language == "Loom") e.Handled = OpenVirtualFileModel(de.Data as String); } else if (action == "ProjectManager.BuildingProject" && (PluginBase.CurrentProject as LoomProject).OutputType == OutputType.Application) { de.Handled = true; PluginBase.MainForm.CallCommand("SaveAllModified", null); LoomHelper.Build(PluginBase.CurrentProject as LoomProject); } else if (action == "ProjectManager.TestingProject" && (PluginBase.CurrentProject as LoomProject).OutputType == OutputType.Application) { de.Handled = true; PluginBase.MainForm.CallCommand("SaveAllModified", null); LoomHelper.Run(PluginBase.CurrentProject as LoomProject); } else if (action == "ProjectManager.Project") { LoomHelper.Monitor(de.Data as LoomProject); } break; case EventType.UIStarted: contextInstance = new Context(settingObject); ValidateSettings(); // Associate this context with Loom language ASContext.RegisterLanguage(contextInstance, "loom"); break; case EventType.FileSave: case EventType.FileSwitch: //if (contextInstance != null) contextInstance.OnFileOperation(e); // TODO syntax check break; } }