Posted 20 years ago
by Greg Shaffer
- Boulder
Hi,
I recently started to use the semantic parser. Since you can identify scope for outlining purposes, I'm wondering if I can somehow identify token scope via the same mechanisms. In other words, I don't want to manually parse.
The reason I ask is that I wish to use the same ISemanticParseData for multiple tokens representing the same variable. Under certain cases, it would be useful to know what scope a token resides so I can assign the correct ISemanticParseData.
For example:
if(true)
{
int x = 0;
...
// do something with x
}
if(true)
{
double x = 0.0;
...
// do something with x. X is a double, not an int.
}
In this example, the token "x" has two different definitions in the same document, but under different scopes.
Is there any built-in, easy way to handle this type of stuff?
Thanks,
Greg
I recently started to use the semantic parser. Since you can identify scope for outlining purposes, I'm wondering if I can somehow identify token scope via the same mechanisms. In other words, I don't want to manually parse.
The reason I ask is that I wish to use the same ISemanticParseData for multiple tokens representing the same variable. Under certain cases, it would be useful to know what scope a token resides so I can assign the correct ISemanticParseData.
For example:
if(true)
{
int x = 0;
...
// do something with x
}
if(true)
{
double x = 0.0;
...
// do something with x. X is a double, not an int.
}
In this example, the token "x" has two different definitions in the same document, but under different scopes.
Is there any built-in, easy way to handle this type of stuff?
Thanks,
Greg