Ambiguity can refer to two related concepts: 'ambiguous calls' and 'ambiguous grammars'.
Questions tagged [ambiguity]
400 questions
4
votes
4 answers
Ambiguous grammar?
hi
there is this question in the book that said
Given this grammer
A --> AA | (A) | epsilon
a- what it generates\
b- show that is ambiguous
now the answers that i think of is
a- adjecent paranthesis
b- it generates diffrent parse tree so its…

bana tayms
- 57
- 4
4
votes
2 answers
Overload Resolution/Ambiguity in name lookup(which one)
$7.3.3/14 (C++03)
struct A { int x(); };
struct B : A { };
struct C : A {
using A::x;
int x(int);
};
struct D : B, C {
using C::x;
int x(double);
};
int f(D* d) {
return d->x(); // ambiguous: B::x or C::x
}
The comment in the code in…

Chubsdad
- 24,777
- 4
- 73
- 129
4
votes
2 answers
Why are these method calls ambiguous?
#include
using String = std::string;
class Base {
protected:
String value;
};
class Readonly : virtual Base {
public:
const String& method() const {
return value;
}
String& method() {
return value;
…

Tenjix
- 539
- 3
- 12
4
votes
2 answers
spotting an Ambiguous BNF
I have an assignment to correct an ambiguous BNF, but I am completely lost. I know this not a true programming question, and I will gladly delete it if it is not an appropriate question for these boards. Are there any good sites where I could learn…

PFranchise
- 6,642
- 11
- 56
- 73
4
votes
2 answers
While converting String to Date got ambiguity between java.util.Date and java.sql.Date
I am trying to get date as input from Date tag of HTML
Birth Date
and accessing on jsp page by using
String strDate = request.getParameter("dob");
but it returns in the format of string and I wanted to convert it in…

Atish Kumbhar
- 579
- 1
- 8
- 21
4
votes
3 answers
VB.NET: Ambiguous class name error when no ambiguity exists
A client of ours reported that when trying to use our .NET .DLL in VB.NET they receive the error:
error BC31429: 'OurClass' is ambiguous because multiple kinds of members with this name exist in namespace 'our.company.nspace'
I've also been able…

Vilx-
- 104,512
- 87
- 279
- 422
4
votes
3 answers
Resolving static method ambiguity
I have been working on understanding java compilation and I have come across a question. Say we have a class set up like this
public class Ambiguity
{
static class G
{
void A()
{
System.out.println("Regular…

Markovian8261
- 909
- 4
- 10
- 23
4
votes
2 answers
Two lambdas passed to template function makes type deduction of parameter ambiguous -- why?
I have a template that works if I pass it one lambda, but in a related template that takes two lambdas mapped to the same templated type, it cannot deduce that type, and MSVC++ Express 2013 complains the template parameter is ambiguous. To be clear…

Charles J. Daniels
- 542
- 3
- 13
4
votes
2 answers
How to iterate "along" a Marpa parse forest rather than "through" its parse trees?
Say I have a nice ambiguous Marpa grammar and a nice ambiguous input string.
I can parse the string with Marpa and end up with a parse forest. I can even iterate through each parse tree in the forest.
But how can I iterate "along" the parse…

hippietrail
- 15,848
- 18
- 99
- 158
4
votes
2 answers
Inconsistencies in compiler ambiguity errors
In this question, the following class is defined:
public class Program
{
int n = 0;
public void Print()
{
Console.WriteLine(n);
}
public Program()
{
}
public Program(int num = 10)
{
n = num;
…

Jon Egerton
- 40,401
- 11
- 97
- 129
4
votes
2 answers
Why does this very simple grammar cause GLR parsers to choke?
I've tried several different parser generators (Bison, DParser, etc.) that claim to be able to generate GLR parsers i.e., ones that can handle ambiguous grammars. Here is a very simple ambiguous grammar of the type I'm talking about:
START: A |…

user3268289
- 175
- 1
- 9
4
votes
3 answers
Ambiguity between settings in C#
I've made an C# app with an GUI and some settings file for user settings. However, when I'm about to read the current values of the settings like MySettings.Default.SettingsName; it works perfectly for the first set of settings, say MyFirstSettings.…

user2950764
- 211
- 4
- 13
4
votes
3 answers
Is there a good use case for fields in interfaces today?
Java allows fields in interfaces. This had some use before java 5. Do they have any good use case today?
Can Someone give me some good use cases where one would use fields in interfaces as opposed to many other ways to satisfy the same design…

MickJ
- 2,127
- 3
- 20
- 34
4
votes
1 answer
Ambiguity between property and event in vb6 com server
In my c# project, I'm referncing an old com server written in vb6. When tyring to access a property "ModuleLoaded" (meaning "IsModuleLoaded"), I get an ambiguity warning because the server also defines an event with the same name. My code looks like…

Bernd L.
- 97
- 2
- 6
4
votes
1 answer
Call of overloaded is ambiguous
I have the following compiler error : "call of overloaded ‘reduceColors(ipl_image_wrapper&, ipl_image_wrapper&, int)’ is ambiguous"
I have a wrapper class for IplImage (DrawingDetection.h):
#include
#include…

Ann Orlova
- 1,338
- 15
- 24