Antlr4.StringTemplate.TemplateGroupFile.Load C# (CSharp) Method

Load() public method

public Load ( ) : void
return void
        public override void Load()
        {
            if (_alreadyLoaded)
                return;

            // do before actual load to say we're doing it
            // no prefix since this group file is the entire group, nothing lives
            // beneath it.
            _alreadyLoaded = true;

            if (Verbose)
                Console.WriteLine("loading group file " + _url.LocalPath);

            LoadGroupFile("/", _url.LocalPath);

            if (Verbose)
                Console.WriteLine("found {0} templates in {1} = {2}", CompiledTemplates.Count, _url.ToString(), CompiledTemplates);
        }

Same methods

TemplateGroupFile::Load ( string name ) : CompiledTemplate

Usage Example

コード例 #1
0
ファイル: TestRegions.cs プロジェクト: JSchofield/antlrcs
        public void TestCantDefineEmbeddedRegionAgain()
        {
            string dir = tmpdir;
            string g = "a() ::= <<[<@r>foo<@end>]>>\n" +
                       "@a.r() ::= <<bar>>\n"; // error; dup
            writeFile(dir, "g.stg", g);

            TemplateGroupFile group = new TemplateGroupFile(Path.Combine(dir, "g.stg"));
            ErrorBuffer errors = new ErrorBuffer();
            group.Listener = errors;
            group.Load();
            string expected = "g.stg 2:3: the explicit definition of region /a.r hides an embedded definition in the same group" + newline;
            string result = errors.ToString();
            Assert.AreEqual(expected, result);
        }
All Usage Examples Of Antlr4.StringTemplate.TemplateGroupFile::Load