X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flexer.h;h=05ce4fe60c13c6c0da8b3ec2c9b8dc90c782ce44;hb=aca29fee7feccaf818e5395b566318e510366e90;hp=0028128167557fd0b07fb0ac8bc92609df1171a8;hpb=eeb3352d718b0cd85afab3f7a7466fcac7791c1c;p=pspp diff --git a/src/lexer.h b/src/lexer.h index 0028128167..05ce4fe60c 100644 --- a/src/lexer.h +++ b/src/lexer.h @@ -14,12 +14,16 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ #if !lexer_h #define lexer_h 1 +#include "var.h" +#include +#include "bool.h" + /* Returns nonzero if character CH may be the first character in an identifier. */ #define CHAR_IS_ID1(CH) \ @@ -41,7 +45,8 @@ enum { T_ID = 256, /* Identifier. */ - T_NUM, /* Number. */ + T_POS_NUM, /* Positive number. */ + T_NEG_NUM, /* Negative number. */ T_STRING, /* Quoted string. */ T_STOP, /* End of input. */ @@ -68,10 +73,9 @@ enum T_N_KEYWORDS = T_LAST_KEYWORD - T_FIRST_KEYWORD + 1 }; - extern int token; extern double tokval; -extern char tokid[9]; +extern char tokid[LONG_NAME_LEN + 1]; extern struct string tokstr; #include @@ -86,10 +90,10 @@ void lex_error (const char *, ...); int lex_end_of_command (void); /* Token testing functions. */ -int lex_integer_p (void); +bool lex_is_number (void); +double lex_number (void); +bool lex_is_integer (void); long lex_integer (void); -int lex_double_p (void); -double lex_double (void); /* Token matching functions. */ int lex_match (int); @@ -108,6 +112,7 @@ int lex_force_string (void); int lex_id_match_len (const char *keyword_string, size_t keyword_len, const char *token_string, size_t token_len); int lex_id_match (const char *keyword_string, const char *token_string); +int lex_id_to_token (const char *id, size_t len); /* Weird token functions. */ int lex_look_ahead (void);