Example #1
0
        public ALSyntaxTreeSymbol GetSyntaxTreeSymbolByPath(int[] path)
        {
            if ((this.RootSymbolWithProperties != null) && (path != null) && (path.Length > 0))
            {
                ALSyntaxTreeSymbol symbol = this.RootSymbolWithProperties;
                for (int i = path.Length - 1; i >= 0; i--)
                {
                    if ((symbol.childSymbols == null) || (path[i] >= symbol.childSymbols.Count))
                    {
                        return(null);
                    }
                    if (path[i] == -1)
                    {
                        symbol = this.RootSymbolWithProperties;
                    }
                    else
                    {
                        symbol = (ALSyntaxTreeSymbol)symbol.childSymbols[path[i]];
                    }
                }
                return(symbol);
            }

            return(null);
        }
Example #2
0
        public ALSyntaxTreeSymbol CreateSerializableCopy()
        {
            ALSyntaxTreeSymbol symbol = new ALSyntaxTreeSymbol();

            symbol.kind           = this.kind;
            symbol.name           = this.name;
            symbol.fullName       = this.fullName;
            symbol.range          = this.range;
            symbol.selectionRange = this.selectionRange;
            symbol.type           = this.type;

            symbol.LoadProperties(this.syntaxTreeNode);

            return(symbol);
        }