Find Jobs
Hire Freelancers

The goal of this project is to give you hands-on experience with lexical analysis. You will extend the provided lexical analyzer to support more token types. The next section lists all new token types that you need to implement. C++ -- 2

$30-250 USD

进行中
已发布将近 4 年前

$30-250 USD

货到付款
i want this project to be by 16th July . And it should be done g++ and tested in ubuntu. 1. Token Types Modify the lexer to support the following 3 token types: REALNUM = NUM DOT digit digit* BASE08NUM = ((pdigit8 digit8*) + 0) (x) (08) BASE16NUM = ((pdigit16 digit16*) + 0) (x) (16) Where digit16 = 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + A + B + C + D + E + F pdigit16 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + A + B + C + D + E + F digit = 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 pdigit = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 digit8 = 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 pdigit8 = 1 + 2 + 3 + 4 + 5 + 6 + 7 Note that NUM and DOT are already defined in the lexer, but here are the regular expressions for the sake of completeness: NUM = (pdigit digit*) + 0 DOT = '.' Note that DOT is a single dot character, the quotes are used to avoid ambiguity. The list of valid tokens including the existing tokens in the code would be as follows: IF WHILE DO THEN PRINT PLUS MINUS DIV MULT EQUAL COLON COMMA SEMICOLON LBRAC RBRAC LPAREN RPAREN NOTEQUAL GREATER LESS LTEQ GTEQ DOT NUM ID REALNUM BASE08NUM BASE16NUM This list should be used to determine the token if the input matches more than one regular expression. Follow these steps: Download the [login to view URL] , lexer.h , [login to view URL] and inputbuf.h files accompanying this project description. Note that these files might be a little different than the code you've seen in class or elsewhere. Add your code to the files to support the token types listed in the previous section. Compile your code using GCC compiler in Ubuntu 19.04 or higher . You will need to use the g++ command to compile your code in a terminal window. Note that you are required to compile and test your code in Ubuntu 19.04 or higher using the GCC compilers. You are free to use any IDE or text editor on any platform, however, using tools available in Ubuntu 19.04 g++ version 4.9 (or tools that you could install on Ububntu 19.04 could save time in the development/compile/test cycle. See next section for more details on how to compile using GCC. Test your code to see if it passes the provided test cases. You will need to extract the test cases from the zip file and run the test script [login to view URL] . More details on this in the next section. Submit your code in canvas before the deadline: For this project you need to update [login to view URL] and lexer.h. The updates that you need to do in lexer.h are minimal and are already implemented in the submission website. So you do not need to upload the lexer.h file in CANVAS. But you still do need to update lexer.h if you want to compile locally. 3.1 Compiling Code with GCC You should compile your programs with the GCC compilers which are available in g++ 4.9 in Ubuntu 19.04. The GCC is a collection of compilers for many programming languages. There are separate commands for compiling C and C++ programs: Use gcc command to compile C programs Use g++ to compile C++ programs Here is an example of how to compile a simple C++ program: $ g++ [login to view URL] If the compilation is successful, gcc will generate an executable file named [login to view URL] in the same folder as the program. You can change the output file name by specifying the -o switch: $ g++ [login to view URL] -o [login to view URL] To enable all warning messages of the GCC compiler, use the -Wall switch: $ g++ -Wall [login to view URL] -o [login to view URL] The same options can be used with gcc to compile C programs. Compiling projects with multiple files If your program is written in multiple source files that should be linked together, you can compile and link all files together with one command: $ g++ [login to view URL] [login to view URL] [login to view URL]
项目 ID: 26556187

关于此项目

1条提案
远程项目
活跃4 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
Hi, hope you are doing well. I have been studying in Computer Science and have over 1000 hours on programming. I have written a lexical analysis for R language before. Please feel free to contact me. It would be my honor if you award me the project.
$100 USD 在7天之内
5.0 (1条评论)
2.6
2.6

关于客户

UNITED STATES的国旗
TEMPE, United States
5.0
1
付款方式已验证
会员自7月 14, 2020起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。