Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parser: use standard functions to parse numbers
modified the get number function to use standard library functions to parse number and convert them; the input string is temporarily put into a standard input string stream and read from it (the entire parser will be changed to this) and as characters of the number are parsed, they are moved from the input stream into a local standard string that will be passed (moved) to the token constructors when the token is created modified the token constructors for creating integer and double constant tokens to take a standard string, though for now it is converted to a c-style string to initialize the QString member variable
- Loading branch information
1 parent
20e46cc
commit 8513875
Showing
4 changed files
with
59 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,8 @@ | |
#ifndef PARSER_H | ||
#define PARSER_H | ||
|
||
#include <sstream> | ||
|
||
#include <QString> | ||
|
||
#include "token.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters