//done private BlockType GetBlock(string Name) { if (_Blocks[Name] == null) { Fireball.Syntax.BlockType b = new Fireball.Syntax.BlockType(_Language); _Blocks.Add(Name, b); } return((BlockType)_Blocks[Name]); }
private void FillBlocks(BlockType blockType) { if (blockType==null) return; if (_Blocks[blockType]!=null) return; _Blocks[blockType]=blockType; foreach (BlockType current in blockType.ChildBlocks) { FillBlocks(current); } foreach (Scope current in blockType.ScopePatterns) { FillBlocks(current.SpawnBlockOnEnd); FillBlocks(current.SpawnBlockOnStart); } }
/// <summary> /// For public use only /// </summary> /// <param name="BlockType"></param> /// <param name="StartWord"></param> /// <param name="IgnoreStartWord"></param> /// <returns></returns> public Word FindRightWordByBlockType(BlockType BlockType, Word StartWord, bool IgnoreStartWord) { int i = StartWord.Index; if (IgnoreStartWord) i++; Word w = null; while (i < mWords.Count) { w = this[i]; if (w.Segment.BlockType == BlockType && w.Type != WordType.xtSpace && w.Type != WordType.xtTab) { return w; } i++; } return null; }
/// <summary> /// For public use only /// </summary> /// <param name="BlockType"></param> /// <param name="StartWord"></param> /// <param name="IgnoreStartWord"></param> /// <returns></returns> public Word FindLeftWordByBlockType(BlockType BlockType, Word StartWord, bool IgnoreStartWord) { int i = StartWord.Index; if (IgnoreStartWord) i--; Word w = null; while (i >= 0) { w = this[i]; if (w.Segment.BlockType == BlockType && w.Type != WordType.xtSpace && w.Type != WordType.xtTab) { return w; } i--; } return null; }
//done private BlockType GetBlock(string Name) { if (_Blocks[Name] == null) { Fireball.Syntax.BlockType b = new Fireball.Syntax.BlockType(_Language); _Blocks.Add(Name, b); } return (BlockType)_Blocks[Name]; }
public PatternListList(BlockType parent) { this.Parent = parent; }
//done private BlockType GetBlock(string Name) { if (_Blocks.ContainsKey(Name) == false) { Fireball.Syntax.BlockType b = new Fireball.Syntax.BlockType(_Language); _Blocks.Add(Name, b); } return (BlockType)_Blocks[Name]; }
private void FillBlocks(BlockType blockType) { if (blockType == null) return; if (_Blocks.ContainsKey(blockType) == true ) return; else _Blocks.Add(blockType, blockType); foreach (BlockType current in blockType.ChildBlocks) { FillBlocks(current); } foreach (Scope current in blockType.ScopePatterns) { FillBlocks(current.SpawnBlockOnEnd); FillBlocks(current.SpawnBlockOnStart); } }
/// <summary> /// /// </summary> /// <param name="parent"></param> public ScopeCollection(BlockType parent) { Parent = parent; }