コード例 #1
0
 protected IList<CharPos> Extract(IBraceScanner extractor, string input, int start, int state, bool reset=true)
 {
     if ( reset ) extractor.Reset(0);
       ITextChars chars = new StringChars(input, start);
       IList<CharPos> list = new List<CharPos>();
       CharPos cp = CharPos.Empty;
       while ( !chars.EndOfLine ) {
     if ( extractor.Extract(chars, ref cp) )
       list.Add(cp);
       }
       return list;
 }
コード例 #2
0
        protected IList<CharPos> ExtractWithLines(IBraceScanner extractor, string input, int start, int state)
        {
            extractor.Reset(0);

              input = input.Substring(start);

              String[] lines = input.Split('\r', '\n');
              List<CharPos> result = new List<CharPos>();
              foreach ( String line in lines ) {
            ITextChars chars = new StringChars(line);
            CharPos cp = CharPos.Empty;
            while ( !chars.EndOfLine ) {
              if ( extractor.Extract(chars, ref cp) )
            result.Add(cp);
            }
              }
              return result;
        }
コード例 #3
0
 private IList<CharPos> Extract(IBraceExtractor extractor, string input, int start, int state)
 {
     extractor.Reset();
       ITextChars chars = new StringChars(input, start);
       return extractor.Extract(chars).ToList();
 }
コード例 #4
0
        private IList<CharPos> Extract(IBraceExtractor extractor, string input, int start, int state)
        {
            extractor.Reset();

              input = input.Substring(start);

              String[] lines = input.Split('\r', '\n');
              List<CharPos> result = new List<CharPos>();
              foreach ( String line in lines ) {
            ITextChars chars = new StringChars(line);
            while ( !chars.EndOfLine ) {
              result.AddRange(extractor.Extract(chars));
            }
              }
              return result;
        }