@@ -16,38 +16,19 @@ public enum ReferenceType
1616
1717 public class ParserReference
1818 {
19- public const int MaxRangeHeight = 1048576 ;
20- public const int MaxRangeWidth = 16384 ;
21-
2219 public ReferenceType ReferenceType { get ; set ; }
20+ public ParseTreeNode ReferenceNode { get ; set ; }
2321 public string LocationString { get ; set ; }
2422 public string Worksheet { get ; set ; }
2523 public string LastWorksheet { get ; set ; }
2624 public string FilePath { get ; set ; }
2725 public string FileName { get ; set ; }
28- public string Name { get ; private set ; }
29- public string MinLocation { get ; set ; } //Location as appearing in the formula, eg $A$1
26+ public string Name { get ; set ; }
27+ public string MinLocation { get ; set ; }
3028 public string MaxLocation { get ; set ; }
3129 public string [ ] TableSpecifiers { get ; set ; }
3230 public string [ ] TableColumns { get ; set ; }
33-
34- public ParserReference ( ReferenceType referenceType , string locationString = null , string worksheet = null , string lastWorksheet = null ,
35- string filePath = null , string fileName = null , string name = null , string minLocation = null , string maxLocation = null ,
36- string [ ] tableSpecifiers = null , string [ ] tableColumns = null )
37- {
38- ReferenceType = referenceType ;
39- LocationString = locationString ;
40- Worksheet = worksheet ;
41- LastWorksheet = lastWorksheet ;
42- FilePath = filePath ;
43- FileName = fileName ;
44- Name = name ;
45- MinLocation = minLocation ;
46- MaxLocation = maxLocation != null ? maxLocation : minLocation ;
47- TableColumns = tableColumns ;
48- TableSpecifiers = tableSpecifiers ;
49- }
50-
31+
5132 public ParserReference ( ParseTreeNode node )
5233 {
5334 InitializeReference ( node ) ;
@@ -123,6 +104,7 @@ public void InitializeReference(ParseTreeNode node)
123104 break ;
124105 }
125106
107+ ReferenceNode = node ;
126108 LocationString = node . Print ( ) ;
127109 }
128110
@@ -131,24 +113,9 @@ private string UnEscape(string value, string escapeCharacter)
131113 return System . Text . RegularExpressions . Regex . Replace ( value , $ "{ escapeCharacter } (?!{ escapeCharacter } )", "" ) ;
132114 }
133115
134- /// <summary>
135- /// Converts the column number to an Excel column string representation.
136- /// </summary>
137- /// <param name="columnNumber">The zero-based column number.</param>
138- private string ConvertColumnToStr ( int columnNumber )
139- {
140- var sb = new System . Text . StringBuilder ( ) ;
141- while ( columnNumber >= 0 )
142- {
143- sb . Insert ( 0 , ( char ) ( 65 + columnNumber % 26 ) ) ;
144- columnNumber = columnNumber / 26 - 1 ;
145- }
146- return sb . ToString ( ) ;
147- }
148-
149116 public override string ToString ( )
150117 {
151- return ReferenceType == ReferenceType . Cell ? MinLocation . ToString ( ) : string . Format ( "{0}:{1}" , MinLocation , MaxLocation ) ;
118+ return LocationString ;
152119 }
153120 }
154121}
0 commit comments