Exemplo n.º 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();
        }
Exemplo n.º 2
0
        public static TreeNode Convert(GMacAst ast)
        {
            var converter = new GMacAstToTreeViewNodesByRole();

            converter.Visit(ast);

            return(converter.DslNode);
        }
Exemplo n.º 3
0
        internal FormInteractiveScript(GMacAst ast)
        {
            InitializeComponent();

            _gmacAst = ast;

            ResetScriptManager();
        }
Exemplo n.º 4
0
        public void Visit(GMacAst dsl)
        {
            InitializeRoleNodes(dsl);

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

            ResetCompilationInterface();

            ChangeOpenedSourceFile(null);
        }
Exemplo n.º 6
0
        internal FormAstExplorer(GMacAst ast)
        {
            InitializeComponent();

            Root = new AstRoot(ast);

            _astDescriptionVisitor = new GMacAstDescriptionVisitor(Root);

            FillComponentsTree();
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 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();
        }
Exemplo n.º 9
0
 public LlDataTable(GMacAst dsl)
 {
     GMacRootAst = dsl;
 }
Exemplo n.º 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);
        }
Exemplo n.º 11
0
        protected override void InitializeRootAst()
        {
            RootAst = new GMacAst();

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

        //    _generatedGMacSymbolTable = null;
        //}


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