Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile newick_parser #26

Closed
ArtPoon opened this issue May 22, 2019 · 3 comments
Closed

Compile newick_parser #26

ArtPoon opened this issue May 22, 2019 · 3 comments

Comments

@ArtPoon
Copy link

ArtPoon commented May 22, 2019

Currently we're carrying around these files:

  • newick_parser.c
  • newick_parser.h
  • newick_lexer.c

These were generated from the source files newick_lexer.l and newick_parser.y ages ago and we've had a difficult time reproducing this process since. Unfortunately this is a problem for making a portable distribution.

I have been able to compile the above source files in Ubuntu 18.04 as follows:

bison -d newick_parser.y
flex newick_lexer.l
gcc newick_parser.tab.c lex.yy.c -lfl -lm -ligraph

which yields the default binary a.out.

How do we generate the .c and .h files mentioned at the top of this post?

@ArtPoon
Copy link
Author

ArtPoon commented May 22, 2019

Ok, newick_praser.tab.h and newick_parser.h are nearly identical:

art@orolo:~/git/clmp/src$ diff newick_parser.tab.h newick_parser.h
33,34c33,34
< #ifndef YY_YY_NEWICK_PARSER_TAB_H_INCLUDED
< # define YY_YY_NEWICK_PARSER_TAB_H_INCLUDED
---
> #ifndef YY_YY_NEWICK_PARSER_H_INCLUDED
> # define YY_YY_NEWICK_PARSER_H_INCLUDED
56a57,64
> /* Tokens.  */
> #define COLON 258
> #define SEMICOLON 259
> #define LPAREN 260
> #define RPAREN 261
> #define COMMA 262
> #define STRING 263
> #define NUMBER 264
63c71
< #line 25 "newick_parser.y" /* yacc.c:1909  */
---
> #line 26 "newick_parser.y" /* yacc.c:1909  */
68c76
< #line 69 "newick_parser.tab.h" /* yacc.c:1909  */
---
> #line 77 "newick_parser.h" /* yacc.c:1909  */
81c89
< #endif /* !YY_YY_NEWICK_PARSER_TAB_H_INCLUDED  */
---
> #endif /* !YY_YY_NEWICK_PARSER_H_INCLUDED  */

so there should be some option for removing the tab annotation.

@ArtPoon
Copy link
Author

ArtPoon commented May 22, 2019

lex.yy.c is similar to newick_lexer.c but my version of flex is different (2.6.4 versus 2.5.35)

@ArtPoon
Copy link
Author

ArtPoon commented May 22, 2019

Give up if we can get packages working on macOS and Windows - this is only an issue if we need to change parser.

@ArtPoon ArtPoon closed this as completed May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant