Questions tagged [ambiguity]

Ambiguity can refer to two related concepts: 'ambiguous calls' and 'ambiguous grammars'.

400 questions
0
votes
1 answer

How to Remove the ambiguity from the following grammar?

Remove the ambiguity from the following grammar S −−> if E then S | if E then S else S | other
Tapon Roy
  • 11
  • 2
0
votes
1 answer

Finding source of choice conflict in JavaCC grammar

I have a JavaCC grammar with a troublesome section that can be reduced to this: void Start(): {} { A() } void A(): {} { ( "(" A() ")" | "biz" ) ( B() | C() )* } void B(): {} { "foo" A() } void C(): {} { "bar" A() } When I compile…
sfitts
  • 938
  • 2
  • 9
  • 17
0
votes
1 answer

How to reselove ambiguity when when using reflection?

I'm trying to perform the following line in Kotlin: var str: KFunction = String::toUpperCase But compiler says: Overload resolution ambiguity. All these functions match. public inline fun String.toUpperCase(): String defined in…
DorVak
  • 297
  • 2
  • 9
0
votes
1 answer

How to return a specific constructor when using reflection?

I'm reading the following document : Constructor References There is explained how to send a referenced to constructor. But they don't described a situation when there is more than one constructor (overloaded constructor). The following code makes…
Eitanos30
  • 1,331
  • 11
  • 19
0
votes
1 answer

How to get the second leftmost derivation in this example?

Using the grammar below, my text says that the string "the girl touches the boy with the flower" can be leftmost derived in two ways making the grammar ambiguous. When I try to find the second derivation, I fail. I really do not see how a second…
0
votes
1 answer

error: request for member is ambiguous c++;

I've already reviewed several similar questions at StackOverflow, but nothing helps. I can't understand why the keyword using in my class NetflixCanada does not resolve the ambiguity. What I want to achieve: to access 2nd time a private method from…
max
  • 166
  • 13
0
votes
1 answer

Why doesn't 'using A::X' avoid ambiguity with multiple inheritance?

This is similar to this question and this one, but I think (hope!) different enough to deserve an explanation. I have a complex configuration framework, with decorator classes used to implement some common, simple actions (like flagging when a class…
0
votes
2 answers

Ambiguity for Variable but not for Method

We have an interface and class with no relation each having methods with same signature. These can be related to a class which would compile fine. interface A { void test(); } class B { public void test() { …
Arun Sudhakaran
  • 2,167
  • 4
  • 27
  • 52
0
votes
2 answers

C++ : user defined Explicit type conversion function error

Here is how the code looks: using namespace std; class dummy{ public: int x; explicit dummy(int x = 0) : x{ this->x = x } {}; //explicit has no effect here }; class myClass { public: operator int(); //<---problematic conversion …
0
votes
1 answer

Could an algorithm be non deterministic or ambiguous?

CLSR says that an algorithm is a "well defined procedure".What exactly is meant by "well defined". Does it mean that it should not be ambiguous or non deterministic. If yes what could be meant by an algorithm being ambiguous or non deterministic.
0
votes
1 answer

std::list Iterator doesn't get assigned

Sorry about the vague question title, but I have these typedefs here: typedef std::list Timeline; typedef Timeline::iterator Keyframe; and let's say a class like this: class foo { Timeline timeline; Keyframe left,right; }; I…
Erius
  • 1,021
  • 8
  • 21
0
votes
1 answer

Ambiguity Between Workbook Event And Method E.g. Sync

I am getting an ambiguity error that seems to be between an event and a property name. I have a class that is implementing the Microsoft.Office.Interop.Excel.Workbook interface and decorating it with extra logic. The interface is being implemented…
Colm Bhandal
  • 3,343
  • 2
  • 18
  • 29
0
votes
0 answers

Object movement ambiguity

I'm trying to move a rectangular over the screen with WASD. My problem is that when the user tries to change the direction of the paddle twice too fast (let's say you press left, then right and left again super fast), the object freezes for a split…
emir3333
  • 7
  • 4
0
votes
4 answers

REBOL path operator vs division ambiguity

I've started looking into REBOL, just for fun, and as a fan of programming languages, I really like seeing new ideas and even just alternative syntaxes. REBOL is definitely full of these. One thing I noticed is the use of '/' as the path operator…
Russell Leggett
  • 8,795
  • 3
  • 31
  • 45
0
votes
1 answer

How could I access java Runtime.getRuntime() if the project already have a Runtime Class?

I have a code running inside Sinalgo Distributed Algorithm simulator. Sinalgo main thread is named Runtime and it needs to be imported inside all projects to run properly. I also use Sinalgo´s Runtime class. So I have: import…
bruno
  • 15
  • 5