Exemplo n.º 1
0
 public ParserMessage(ParserErrorLevel level, SourceLocation location, string message, ParserState parserState)
 {
     Level       = level;
     Location    = location;
     Message     = message;
     ParserState = parserState;
 }
Exemplo n.º 2
0
 public ParserMessage(ParserErrorLevel level, SourceSpan span, string message, ParserState parserState)
 {
     Level       = level;
     Span        = span;
     Location    = span.Location;
     Message     = message;
     ParserState = parserState;
 }
Exemplo n.º 3
0
 public void AddParserMessage(ParserErrorLevel level, SourceSpan span, string message, params object[] args)
 {
     if (CurrentParseTree == null)
     {
         return;
     }
     if (CurrentParseTree.ParserMessages.Count >= MaxErrors)
     {
         return;
     }
     if (args != null && args.Length > 0)
     {
         message = string.Format(message, args);
     }
     AddParserMessage(new ParserMessage(level, span, message, CurrentParserState));
 }
Exemplo n.º 4
0
 public void AddParserMessage(ParserErrorLevel level, SourceLocation location, string message, params object[] args)
 {
     if (CurrentParseTree == null)
     {
         return;
     }
     if (CurrentParseTree.ParserMessages.Count >= MaxErrors)
     {
         return;
     }
     if (args != null && args.Length > 0)
     {
         message = string.Format(message, args);
     }
     CurrentParseTree.ParserMessages.Add(new ParserMessage(level, location, message, CurrentParserState));
     if (OptionIsSet(ParseOptions.TraceParser))
     {
         ParserTrace.Add(new ParserTraceEntry(CurrentParserState, ParserStack.Top, CurrentParserInput, message, true));
     }
 }
 public void AddParserMessage(ParserErrorLevel level, SourceLocation location, string message, params object[] args) {
   if (CurrentParseTree == null) return; 
   if (CurrentParseTree.ParserMessages.Count >= MaxErrors) return;
   if (args != null && args.Length > 0)
     message = string.Format(message, args);
   CurrentParseTree.ParserMessages.Add(new ParserMessage(level, location, message, CurrentParserState));
   if (OptionIsSet(ParseOptions.TraceParser)) 
     ParserTrace.Add( new ParserTraceEntry(CurrentParserState, ParserStack.Top, CurrentParserInput, message, true));
 }
Exemplo n.º 6
0
 /* Added by sones developers */
 // Ctor and Property added to take a 'Exeption'
 public ParserMessage(ParserErrorLevel level, SourceLocation location, string message, ParserState parserState, Exception exception)
     : this(level, location, message, parserState)
 {
     Exception = exception;
 }
Exemplo n.º 7
0
 public ExternalErrorMessage(string filepath, ParserErrorLevel level, SourceLocation location, string message, ParserState parserState)
     : base(level, location, message, parserState)
 {
     FilePath = filepath;
 }
Exemplo n.º 8
0
 public void AddParserMessage(ParserErrorLevel level, SourceLocation location, string message, params object[] args)
 {
     AddParserMessage(level, new SourceSpan(location, 1), message, args);
 }
Exemplo n.º 9
0
        public static ParseResult Process(string InPath = null, LanguageOption?InSpec = null, string OutPath = null, string OutFile = null, bool OverwriteOut = false, LanguageOption OutSpec = LanguageOption.Native, bool CheckOnly = false, ParserErrorLevel detaillevel = (ParserErrorLevel)(-1))
        {
            DirectoryInfo diIn = null, diOut = null;

            FileInfo[] Files = null;

            if (InPath != null)
            {
                if (Directory.Exists(InPath))
                {
                    diIn = new DirectoryInfo(InPath);
                }
                else if (!InPath.Contains(Path.DirectorySeparatorChar))
                {
                    diIn = new DirectoryInfo(Directory.GetCurrentDirectory());
                }
                else
                {
                    try { diIn = new DirectoryInfo(Path.GetDirectoryName(InPath) ?? Path.GetFullPath(InPath)); }
                    catch (ArgumentException ex) { throw new UOSLArgumentException("Invalid input path.", ex); }
                }