/* SCCS - @(#)Double_Token.java 1.2 - 02/28/99 - 12:39:09 */ /* * Copyright (c) 1997 USC Brain Project. email nsl@java.usc.edu. */ package npp.src.util; import java.lang.String; import pp.src.jbf.*; public class Double_Token extends YYtoken { public double double_val; public Double_Token(int ttype, String txt, int lno, int chno, int chno0){ super(ttype, txt, lno, chno, chno0); // do more processing later String str; if (txt.endsWith("d") || txt.endsWith("D")) { str = txt.substring(0,txt.length()-1); // Utility.assert(str.length() == lexeme().length() - 1); } else str = txt; try { double_val = (java.lang.Double.valueOf(str)).doubleValue(); } catch (NumberFormatException e) { System.err.println("Double number parse error at line:" +lno+" char:"+chno); } } public Double_Token(int ttype, StringBuffer txt, int lno, int chno, int cno0) { this(ttype,txt.toString(),lno,chno,cno0); } public Double_Token(int ttype, YYlexbuffer txt) { this(ttype,txt.lexeme(),txt.yyline(),txt.yychar(),txt.yychar0()); } }