Beispiel #1
0
        private void InitializeRoleNodes(GMacAst dsl)
        {
            RoleNodes = new TreeNode[8];

            RoleNodes[NamespacesNode] = new TreeNode("Namespaces");

            RoleNodes[FramesNode] = new TreeNode("Frames");

            RoleNodes[FrameSubspacesNode] = new TreeNode("Subspaces");

            RoleNodes[ConstantsNode] = new TreeNode("Constants");

            RoleNodes[StructuresNode] = new TreeNode("Structures");

            RoleNodes[MacrosNode] = new TreeNode("Macros");

            RoleNodes[MacroTemplatesNode] = new TreeNode("Macro Templates");

            RoleNodes[TransformsNode] = new TreeNode("Transforms");


            DslNode = new TreeNode("GMacDSL")
            {
                Tag = dsl
            };

            DslNode.Nodes.AddRange(RoleNodes);

            DslNode.Expand();
        }
Beispiel #2
0
        public static TreeNode Convert(GMacAst ast)
        {
            var converter = new GMacAstToTreeViewNodesByRole();

            converter.Visit(ast);

            return(converter.DslNode);
        }
        internal FormInteractiveScript(GMacAst ast)
        {
            InitializeComponent();

            _gmacAst = ast;

            ResetScriptManager();
        }
Beispiel #4
0
        public void Visit(GMacAst dsl)
        {
            InitializeRoleNodes(dsl);

            foreach (var childSymbol in dsl.ChildNamespaces)
            {
                Visit(childSymbol);
            }
        }
Beispiel #5
0
        private void InitializeProject(GMacProject gmacDslProject)
        {
            _dslProject  = gmacDslProject;
            _dslCompiler = new GMacProjectCompiler();
            _astRoot     = null;

            ResetCompilationInterface();

            ChangeOpenedSourceFile(null);
        }
Beispiel #6
0
        internal FormAstExplorer(GMacAst ast)
        {
            InitializeComponent();

            Root = new AstRoot(ast);

            _astDescriptionVisitor = new GMacAstDescriptionVisitor(Root);

            FillComponentsTree();
        }
        public TreeNode Visit(GMacAst dsl)
        {
            var node = new TreeNode("<DSL> GMac")
            {
                Tag = dsl
            };

            foreach (var childSymbol in dsl.ChildNamespaces)
            {
                node.Nodes.Add(Visit(childSymbol));
            }

            return(node);
        }
Beispiel #8
0
        private void SetEditorTextChangedStatus(bool flag)
        {
            if (flag == _editorTextChangedStatus)
            {
                return;
            }

            _editorTextChangedStatus = flag;

            if (SourceCodeTextEditor.IsChanged != flag)
            {
                SourceCodeTextEditor.IsChanged = flag;
            }

            if (!flag)
            {
                _astRoot = null;
            }

            UpdateInterface_EnableControls();
        }
Beispiel #9
0
 public LlDataTable(GMacAst dsl)
 {
     GMacRootAst = dsl;
 }
Beispiel #10
0
        private bool CompileSourceFiles(bool forceCompilation = false)
        {
            if (AskSaveSourceCode() == false)
            {
                return(false);
            }

            ResetCompilationInterface();

            var startCompilationTime = DateTime.Now;

            textBoxOutputLog.Text =
                startCompilationTime.ToLongTimeString() +
                @" Start Compilation" +
                Environment.NewLine;

            Application.DoEvents();

            GMacSystemUtils.ResetProgress();

            _dslCompiler.Compile(_dslProject, forceCompilation);

            var endCompilationTime = DateTime.Now;

            textBoxOutputLog.Text += _dslCompiler.CompilationLog.Progress.History.ToString();

            //textBoxOutputLog.Text += _dslCompiler.CompilationLog.TimeCounter.RootEventsSpanToString();

            textBoxOutputLog.Text +=
                endCompilationTime.ToLongTimeString() +
                @" End Compilation " +
                (_dslCompiler.CompilationLog.HasErrors ? @"with errors " : String.Empty) +
                @"after " +
                (endCompilationTime - startCompilationTime) +
                Environment.NewLine;

            FillErrorList(_dslCompiler.CompilationLog);

            FillWarningList(_dslCompiler.CompilationLog);

            UpdateInterface_SourceFilesList();

            if (_dslCompiler.CompilationLog.HasErrors)
            {
                listViewErrors.SelectedIndices.Add(0);

                tabControl2.SelectedTab = tabPageErrors;

                MarkSelectedError();
            }
            else
            {
                _astRoot = _dslCompiler.RootGMacAst;

                FillComponentsTree();

                tabControl1.SelectedTab = tabPageComponents;
            }

            return(true);
        }
Beispiel #11
0
        protected override void InitializeRootAst()
        {
            RootAst = new GMacAst();

            RootGMacAst.InitializeAst();
        }
Beispiel #12
0
 internal static AstRoot ToAstRoot(this GMacAst ast)
 {
     return(new AstRoot(ast));
 }
Beispiel #13
0
 internal AstRoot(GMacAst ast)
 {
     AssociatedAst = ast;
 }
Beispiel #14
0
        //public override void ResetOnAcquire()
        //{
        //    base.ResetOnAcquire();

        //    _generatedGMacSymbolTable = null;
        //}


        private void SetContext(GMacSymbolTranslatorContext context)
        {
            SetContext((SymbolTranslatorContext)context);
            _generatedGMacSymbolTable = context.GMacRootAst;
        }