Win a copy of Terraform in Action this week in the Cloud forum!

ravindra koranga

Greenhorn
+ Follow
since Jul 30, 2016
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by ravindra koranga

I got the solution to this problem. To anyone else facing same problem here is the solution.
for warning part add
#define YYSTYPE char * in the definition section of both file.l and file.y
For part 2)
The bison parser calls yylex() whenever it needs a token. So no need to run yylex(). just run yyparse();
so main function of file.l is
4 years ago

0
down vote
favorite
I am new to flex and bison. I am trying to write a simple grammar accepting the strings :a word in lowercase followed by a word in upper case. below are my files-

file.l



file.y


contents of file.txt is:
token TOKEN

this is how i compile and run:
flex file.l
yacc -d file.y
gcc lex.yy.c y.tab.c -o file
./file

The program gives warning warning: assignment makes integer from pointer without a cast [-Wint-conversion] yylval=yytext;

When I run the program (ignoring warning), the output is "found lower" i.e the program stops reading tokens after . Can anyone help and tell me why is this running like this?Also why is the warning generated even though i specified in file.y
4 years ago
Yes. I added a Toast before and after save function. That shows save fun is called. Also onSensorChanged() is called too.
5 years ago
Actually I have cropped the code. The try block has on more statement at the last


So full code goes lik this


5 years ago
try {
           fOut.close();
    } catch (IOException e)
    {

    }
//I tried this after calling save function.It does not help.
5 years ago
I wish to log data accelerometer onto a file in the form of float values. I tried following:



In this code the file is created in the internal storage but there is no data written to it. File is created with zero size. Why does this happen? Please help.

5 years ago
Is this code correct?


5 years ago
I think I cannot figure it out. Will you please guide me?
5 years ago
sorry, the previous code is not right.
Here is the correct one

5 years ago
Is this right

5 years ago
how about now

5 years ago
OK I got it. I should do it like below and it works

5 years ago
I am creating an array of semaphores as follows. it compiles correctly but gives" segmentation fault "error on execution.Can anyone tell me why?
5 years ago
How would i declare a pointer which points to 2d array of character pointers. like
char *ar[10][10];
In my understanding this array is stored as array of array, so ar points to array of pointers , each of which points to a column in this array. So it has three level of pointers. So it should be declared as
char ***p;
Thus both ar and p are of same type.
But if I use this p like 2d array for e.g. p[0][0], it gives error as segmentation fault. Why does this happen and what would be the correct way to declare p?
5 years ago