// Copyright 2008 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//----------------------------------------------------
// The following code was generated by CUP v0.10k TUM Edition 20050516
// Fri Jan 04 18:13:12 GMT 2008
//----------------------------------------------------
package com.google.calculator.parser;
import com.google.calculator.tree.*;
import java_cup.runtime.*;
import java.util.ArrayList;
/** CUP v0.10k TUM Edition 20050516 generated parser.
* @version Fri Jan 04 18:13:12 GMT 2008
*/
public class parser extends java_cup.runtime.lr_parser {
/** Default constructor. */
public parser() {super();}
/** Constructor which sets the default scanner. */
public parser(java_cup.runtime.Scanner s) {super(s);}
/** Production table. */
protected static final short _production_table[][] =
unpackFromStrings(new String[] {
"\000\017\000\002\003\005\000\002\002\004\000\002\003" +
"\005\000\002\003\005\000\002\003\005\000\002\003\003" +
"\000\002\003\003\000\002\003\005\000\002\003\004\000" +
"\002\003\005\000\002\003\003\000\002\004\005\000\002" +
"\004\006\000\002\005\003\000\002\005\005" });
/** Access to production table. */
public short[][] production_table() {return _production_table;}
/** Parse-action table. */
protected static final short[][] _action_table =
unpackFromStrings(new String[] {
"\000\034\000\012\004\007\010\006\014\004\015\011\001" +
"\002\000\022\002\ufffc\005\ufffc\006\ufffc\007\ufffc\010\ufffc" +
"\011\ufffc\012\ufffc\013\ufffc\001\002\000\022\002\ufff7\005" +
"\ufff7\006\ufff7\007\ufff7\010\ufff7\011\ufff7\012\ufff7\013\ufff7" +
"\001\002\000\012\004\007\010\006\014\004\015\011\001" +
"\002\000\012\004\007\010\006\014\004\015\011\001\002" +
"\000\016\002\033\007\016\010\017\011\021\012\020\013" +
"\022\001\002\000\024\002\ufffb\004\012\005\ufffb\006\ufffb" +
"\007\ufffb\010\ufffb\011\ufffb\012\ufffb\013\ufffb\001\002\000" +
"\014\004\007\005\013\010\006\014\004\015\011\001\002" +
"\000\022\002\ufff6\005\ufff6\006\ufff6\007\ufff6\010\ufff6\011" +
"\ufff6\012\ufff6\013\ufff6\001\002\000\006\005\031\006\030" +
"\001\002\000\020\005\ufff4\006\ufff4\007\016\010\017\011" +
"\021\012\020\013\022\001\002\000\012\004\007\010\006" +
"\014\004\015\011\001\002\000\012\004\007\010\006\014" +
"\004\015\011\001\002\000\012\004\007\010\006\014\004" +
"\015\011\001\002\000\012\004\007\010\006\014\004\015" +
"\011\001\002\000\012\004\007\010\006\014\004\015\011" +
"\001\002\000\022\002\ufff8\005\ufff8\006\ufff8\007\ufff8\010" +
"\ufff8\011\ufff8\012\ufff8\013\ufff8\001\002\000\022\002\ufffe" +
"\005\ufffe\006\ufffe\007\ufffe\010\ufffe\011\ufffe\012\ufffe\013" +
"\022\001\002\000\022\002\ufffd\005\ufffd\006\ufffd\007\ufffd" +
"\010\ufffd\011\ufffd\012\ufffd\013\022\001\002\000\022\002" +
"\uffff\005\uffff\006\uffff\007\uffff\010\uffff\011\021\012\020" +
"\013\022\001\002\000\022\002\001\005\001\006\001\007" +
"\001\010\001\011\021\012\020\013\022\001\002\000\012" +
"\004\007\010\006\014\004\015\011\001\002\000\022\002" +
"\ufff5\005\ufff5\006\ufff5\007\ufff5\010\ufff5\011\ufff5\012\ufff5" +
"\013\ufff5\001\002\000\020\005\ufff3\006\ufff3\007\016\010" +
"\017\011\021\012\020\013\022\001\002\000\004\002\000" +
"\001\002\000\016\005\035\007\016\010\017\011\021\012" +
"\020\013\022\001\002\000\022\002\ufffa\005\ufffa\006\ufffa" +
"\007\ufffa\010\ufffa\011\ufffa\012\ufffa\013\ufffa\001\002\000" +
"\022\002\ufff9\005\ufff9\006\ufff9\007\ufff9\010\ufff9\011\021" +
"\012\020\013\022\001\002" });
/** Access to parse-action table. */
public short[][] action_table() {return _action_table;}
/** <code>reduce_goto</code> table. */
protected static final short[][] _reduce_table =
unpackFromStrings(new String[] {
"\000\034\000\006\003\007\004\004\001\001\000\002\001" +
"\001\000\002\001\001\000\006\003\035\004\004\001\001" +
"\000\006\003\033\004\004\001\001\000\002\001\001\000" +
"\002\001\001\000\010\003\014\004\004\005\013\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\006\003\026\004\004\001\001\000\006\003\025\004\004" +
"\001\001\000\006\003\024\004\004\001\001\000\006\003" +
"\023\004\004\001\001\000\006\003\022\004\004\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\006\003\031\004\004" +
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\002\001\001" +
"" });
/** Access to <code>reduce_goto</code> table. */
public short[][] reduce_table() {return _reduce_table;}
/** Instance of action encapsulation class. */
protected CUP$parser$actions action_obj;
/** Action encapsulation object initializer. */
protected void init_actions()
{
action_obj = new CUP$parser$actions(this);
}
/** Invoke a user supplied parse action. */
public java_cup.runtime.Symbol do_action(
int act_num,
java_cup.runtime.lr_parser parser,
java.util.Stack stack,
int top)
throws java.lang.Exception
{
/* call code in generated class */
return action_obj.CUP$parser$do_action(act_num, parser, stack, top);
}
/** Indicates start state. */
public int start_state() {return 0;}
/** Indicates start production. */
public int start_production() {return 1;}
/** <code>EOF</code> Symbol index. */
public int EOF_sym() {return 0;}
/** <code>error</code> Symbol index. */
public int error_sym() {return 1;}
public static Tree getTree(java.io.InputStream input) throws Exception {
parser p = new parser(new Yylex(input));
Symbol s = p.parse();
return (Tree) s.value;
}
}
/** Cup generated class to encapsulate user supplied action code.*/
class CUP$parser$actions {
private final parser parser;
/** Constructor */
CUP$parser$actions(parser parser) {
this.parser = parser;
}
/** Method with the actual generated action code. */
public final java_cup.runtime.Symbol CUP$parser$do_action(
int CUP$parser$act_num,
java_cup.runtime.lr_parser CUP$parser$parser,
java.util.Stack CUP$parser$stack,
int CUP$parser$top)
throws java.lang.Exception
{
/* Symbol object for return from actions */
java_cup.runtime.Symbol CUP$parser$result;
/* select the action based on the action number */
switch (CUP$parser$act_num)
{
/*. . . . . . . . . . . . . . . . . . . .*/
case 14: // args ::= args COMMA expr
{
ArrayList<Tree> RESULT = null;
int listleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
int listright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
ArrayList<Tree> list = (ArrayList<Tree>)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
Tree e = (Tree)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
list.add(e); RESULT=list;
CUP$parser$result = new java_cup.runtim
没有合适的资源?快使用搜索试试~ 我知道了~
Android(源码)scientific-calculator-for-android( 功能强大的科学计算器).zip
共128个文件
svn-base:50个
java:34个
all-wcprops:15个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 64 浏览量
2023-02-03
10:39:01
上传
评论 1
收藏 549KB ZIP 举报
温馨提示
免责声明:资料部分来源于合法的互联网渠道收集和整理,部分自己学习积累成果,供大家学习参考与交流。收取的费用仅用于收集和整理资料耗费时间的酬劳。 本人尊重原创作者或出版方,资料版权归原作者或出版方所有,本人不对所涉及的版权问题或内容负法律责任。如有侵权,请举报或通知本人删除。
资源推荐
资源详情
资源评论
收起资源包目录
Android(源码)scientific-calculator-for-android( 功能强大的科学计算器).zip (128个子文件)
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 694B
all-wcprops 606B
all-wcprops 492B
all-wcprops 401B
all-wcprops 392B
all-wcprops 170B
all-wcprops 168B
all-wcprops 77B
all-wcprops 70B
all-wcprops 66B
all-wcprops 66B
all-wcprops 66B
COPYING 11KB
calculator.cup 2KB
entries 2KB
entries 1KB
entries 1KB
entries 1013B
entries 943B
entries 801B
entries 703B
entries 593B
entries 399B
entries 391B
entries 276B
entries 263B
entries 253B
entries 252B
entries 245B
parser.java 20KB
Yylex.java 16KB
CalculatorResultListView.java 5KB
PredefinedFunctions.java 4KB
EquationPlotterView.java 3KB
InputTextView.java 3KB
Computer.java 3KB
EquationView.java 3KB
CalculatorInputTextView.java 3KB
ScientificCalculator.java 2KB
ComputationUnit.java 2KB
EquationEditor.java 2KB
Equation.java 2KB
EquationEditorView.java 2KB
ComputationUnitAdapter.java 2KB
EquationAdapter.java 2KB
Function.java 2KB
InternalNode.java 2KB
R.java 1KB
EquationPlotter.java 1KB
sym.java 1KB
ComputationResult.java 1KB
EvaluationContext.java 1KB
ScientificCalculatorApplication.java 1KB
PlotData.java 1KB
TerminalVariable.java 1KB
Multiplication.java 1KB
Substraction.java 1KB
Addition.java 1KB
Division.java 1KB
Tree.java 968B
Opposite.java 934B
TerminalNumber.java 932B
NotPredefinedFunction.java 910B
calculator.lex 1KB
calculator-screenshot3.png 62KB
calculator-screenshot1.png 61KB
calculator-screenshot2.png 53KB
calculator-screenshot4.png 28KB
icon.png 6KB
README 2KB
calculator-screenshot3.png.svn-base 62KB
calculator-screenshot1.png.svn-base 61KB
calculator-screenshot2.png.svn-base 53KB
calculator-screenshot4.png.svn-base 28KB
parser.java.svn-base 20KB
Yylex.java.svn-base 16KB
icon.png.svn-base 6KB
CalculatorResultListView.java.svn-base 5KB
PredefinedFunctions.java.svn-base 4KB
EquationPlotterView.java.svn-base 3KB
InputTextView.java.svn-base 3KB
Computer.java.svn-base 3KB
EquationView.java.svn-base 3KB
CalculatorInputTextView.java.svn-base 3KB
ScientificCalculator.java.svn-base 2KB
ComputationUnit.java.svn-base 2KB
EquationEditor.java.svn-base 2KB
Equation.java.svn-base 2KB
calculator.cup.svn-base 2KB
EquationEditorView.java.svn-base 2KB
ComputationUnitAdapter.java.svn-base 2KB
EquationAdapter.java.svn-base 2KB
Function.java.svn-base 2KB
InternalNode.java.svn-base 2KB
main.xml.svn-base 2KB
R.java.svn-base 1KB
EquationPlotter.java.svn-base 1KB
共 128 条
- 1
- 2
资源评论
大富大贵7
- 粉丝: 389
- 资源: 8868
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 学校课程软件工程常见10道题目以及答案demo
- javaweb新手开发中常见的目录结构讲解
- 新手小白的git使用的手册入门学习demo
- 基于Java观察者模式的info-express多对多广播通信框架设计源码
- 利用python爬取豆瓣电影评分简单案例demo
- 机器人开发中常见的几道问题以及答案demo
- 基于SpringBoot和layuimini的简洁美观后台权限管理系统设计源码
- 实验报告五六代码.zip
- hdw-dubbo-ui基于vue、element-ui构建开发,实现后台管理前端功能.zip
- (Grafana + Zabbix + ASP.NET Core 2.1 + ECharts + Dapper + Swagger + layuiAdmin)基于角色授权的权限体系.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功