クラスの使用に関するドキュメントが不足しているためTSql100Parser
、特定のノードの親を特定する方法はありますか?
私はアセンブリを使用して解析を行っていますMicrosoft.Data.Schema.ScriptDom.Sql
。Microsoft.Data.Schema.ScriptDom
例:
static void __processExpression( Expression expr ) {
if (expr is ParenthesisExpression) {
__processExpression( (expr as ParenthesisExpression).Expression );
}
else if (expr is BinaryExpression) {
__processBinaryExpression( expr as BinaryExpression );
}
else if (expr is Literal) {
Literal lit = (expr as Literal);
ISqlScriptFragment parent = lit.Parent; // <----- this is what I want to do
}
これが不可能な場合は、親を追加パラメーターとして__processExpression()
メソッドに渡すことができますが、公式の方法がある場合はこれを避けたいと思います。