Ejemplo n.º 1
0
 private string VerifyScopeName(string name, Interval nameInterval, DOM.Module module)
 {
     if (string.IsNullOrEmpty(name))
     {
         return(name);
     }
     return(VerifyNsName(name, nameInterval, module));
 }
Ejemplo n.º 2
0
        private string VerifyNsName(string name, Interval nameInterval, DOM.Module module)
        {
            if (Regex.Match(name, @"^[a-zA-Z_][a-zA-Z0-9_\-]*$").Success)
            {
                return(name);
            }

            _context.Errors.Add(CompilerErrorFactory.InvalidNsName(nameInterval, module.FileName));

            return(name);
        }
Ejemplo n.º 3
0
 private string VerifyName(string name, Interval nameInterval, DOM.Module module)
 {
     try
     {
         XmlConvert.VerifyNCName(name);
     }
     catch (Exception)
     {
         _context.Errors.Add(CompilerErrorFactory.InvalidName(nameInterval, module.FileName));
     }
     return(name);
 }
Ejemplo n.º 4
0
        public override void Visit(DOM.Module module)
        {
            _currentModule = (Module)module;
            _namespaceResolver.EnterModule(module);
            _blockStateUnknown = true;
            _blockState        = new Stack <JsonGenerator.BlockStateEnum>();

            Visit(module.NamespaceDefinitions);
            Visit(module.Members.Where(
                      m => (m is DOM.AliasDefinition) ||
                      ((Document)m).Module.ModuleDocument != m ||
                      ((IContainer)m).Entities.Any(e => !(e is DOM.Comment))) //Skipping module documents having only comments in body
                  );
        }
Ejemplo n.º 5
0
 public void EnterModule(DOM.Module node)
 {
     _currentModule       = node;
     _currentModuleMember = null;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Sets current <see cref="Module"/>.
 /// Method should be called from the visitor.
 /// </summary>
 /// <param name="module">Current <see cref="Module"/>.</param>
 public void EnterModule(DOM.Module module)
 {
     _currentModule       = module;
     _currentModuleMember = null;
 }
Ejemplo n.º 7
0
 public PairFactoryForJson(CompilerContext context, DOM.Module module)
 {
     _context = context;
     _module  = module;
 }