Ambiguity can refer to two related concepts: 'ambiguous calls' and 'ambiguous grammars'.
Questions tagged [ambiguity]
400 questions
0
votes
1 answer
Using a word as a language keyword and Identifier in the same ANTLR4 grammar?
Regarding the following reduced grammar
proof_command : 'Proof' 'using' collection '.';
collection : 'Collection' IDENT ':=' section_subset_expr
| 'Collection' KeySOME ':=' IDENT IDENT IDENT
;
KeySOME : 'Some';
(wherease…

Tilman Zuckmantel
- 643
- 1
- 6
- 18
0
votes
1 answer
Return a percentage column using self-join with WHERE clause filtering on the numerator only
UPDATE May 31, 2018: Included a SQLFiddle, in the hopes that somebody can figure out a solution.
The following function contains two CTE's named QuirksCTE and SurplusCTE. Both of these CTE's should filter the numerator of a fraction, while the…

JasperS3000
- 15
- 3
0
votes
1 answer
What makes the use of a recursive descent parser without backtracking impossible other than left recursion and ambiguity?
My initial problem was to find out whether it is possible to parse the following context-free grammar: grammar_part_1 ; grammar_part_2 (examples) and, if not, edit the grammar so that it is.
I looked for two things: left recursion and ambiguity.…
user6371852
0
votes
0 answers
Compiler confuses variable declaration with a function prototype
Consider the following code
struct A {
A() { /* do something */ }
};
struct B {
B(const A& a) { /* do something*/ }
};
int main() {
B b(A());
// the rest of the code
}
So I intended to define b as a variable constructed from a…

Serge Rogatch
- 13,865
- 7
- 86
- 158
0
votes
1 answer
Autofac Interface Ambiguity
"The ambiguity, is in the box" - Monty Python.
Autofac is having a problem resolving an interface. See attached solution.
The Interface, IAmbiguous, is defined in project ACommon. It is implemented in project AInjectable. The AInjectable…

Roark
- 41
- 3
0
votes
1 answer
CFG arithmetic precedence/ambiguity
Been a while since I've worked w/ CFG. Anyways, I have a particular grammar that goes through all the operations properly, but at the end (I excluded other standard mathematic operations).
S ::= S+T | S-T | T
T ::= nonterminal | ID | -S | (S)
per…

DJPlayer
- 3,244
- 2
- 33
- 40
0
votes
2 answers
Approaches on fixing the Ambiguity
I have been asked the following example to fix without modifying both function declaration and call.
void Display(int *nData)
{
}
void Display(float *fData)
{
}
int main()
{
int a = 5;
float b = 4.0f;
Display(&a);
Display(&b);
…

Dinesh G
- 129
- 7
0
votes
2 answers
How to make compiler know which overload of a function to call to avoid ambiguity?
I have a code as below and I don't understand why exactly compiler can't infer the constructor to be used when instance of D class is created.
I have deleted both copy and move constructor so the only alternative would be to use A(Base&)
Is there…

senx
- 630
- 9
- 18
0
votes
2 answers
Why does Global variable show ambiguity error even if there isno local variable?
Code:
#include
using namespace std;
int move=0;
void main()
{
++move;
}
##Error: "move" is ambiguous
How do I overcome this?

Pelican
- 14
- 3
0
votes
4 answers
Select from multiple tables with same condition, avoid ambiguity error
How can I do something like this but avoid the error column common_reference is ambiguous? I know it's ambiguous, I want to select from table_one all the results for common_reference there, and table_two the same.
SELECT * FROM table_one, table_two…

bcmcfc
- 25,966
- 29
- 109
- 181
0
votes
0 answers
Error C2872 during Qt 5.5 compilation using msvc 2010
I'm trying to compile Qt 5.5 with msvc 2010 compiler but with no luck.
My system meets all of the requirments found on the Qt for Windows - Requirements page and I've tried different configurations, but everyone of them fails.
After every failed…

Claudio Cortese
- 1,372
- 2
- 10
- 21
0
votes
0 answers
Prove the grammar are Ambiguous
Can anyone please tell me how to prove this grammar are Ambiguous ? thanks in advance.
I cannot find the string which shows the grammar are Ambiguous :(
G2 = { {S}, {a,b}, {S->ab|ba|SS}, S }

Ejaz Ahamed
- 31
- 4
0
votes
1 answer
Phase Ambiguity of UHF RFID
I am working on a project that detect angle of arrival of RFID Tag by processing the received phases of multiple antennas and I am using the ThingMagic M6 RFID Reader.
The phase of this Reader have an ambiguity of 180 degree, mean that when I read a…

Ben
- 5
- 4
0
votes
0 answers
why ambiguity does not apply in int and float varArgs overload?
I have been learning java basics for quite a while now and I am still learning it. I am learning ambiguity with varArgs in function overloading. But when I tried to write a program to see it happen, I first made a float and int overload, but this…

mitesh
- 235
- 3
- 11
0
votes
0 answers
Call to base member function template ambiguity in C++
I'm trying to implement a DependencyInjectable behavior, and classes that derive from this behavior are able to be injected with the appropriate dependencies upon instantiation.
Below I've tried to extract and condense a sample of code from a much…

Josh Parker
- 133
- 1
- 8