public override void Visit(ColumnDefinition col) { String s = "<COL id='" + col.ColumnIdentifier.Value + "'"; SqlDataTypeReference dt = (SqlDataTypeReference)col.DataType; s = s + " type='" + dt.SqlDataTypeOption + "'></COL>"; sw.WriteLine(s); col.Accept(new NullVisitor()); }
public void Visit(ColumnDefinition col, IList<TSqlParserToken> TKs) { String s = "<COL id='" + col.ColumnIdentifier.Value + "'"; SqlDataTypeReference dt = (SqlDataTypeReference)col.DataType; //search int line = col.DataType.StartLine; int offset = col.DataType.StartOffset; int FragmentLength = col.DataType.FragmentLength; StringBuilder R = new StringBuilder(""); int start = 0; for (int k = col.FirstTokenIndex; k<col.LastTokenIndex; k++) { TSqlParserToken TK = TKs.ElementAt(k); if (TK.Line == line)// && TK.Offset >= (offset + FragmentLength)) { if (TK.TokenType == TSqlTokenType.LeftParenthesis) { start = 1; } if (start == 1) { R.Append(TK.Text); } if (TK.TokenType == TSqlTokenType.RightParenthesis) { break; } } // else break; } s = s + " type='" + dt.SqlDataTypeOption + R + "'></COL>"; // TKs[col.LastTokenIndex+1] sw.WriteLine(s); col.Accept(new NullVisitor()); }