// 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应用源码( 功能强大的科学计算器)-IT计算机-毕业设计.zip (256个子文件)
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 1KB
all-wcprops 694B
all-wcprops 694B
all-wcprops 606B
all-wcprops 606B
all-wcprops 492B
all-wcprops 492B
all-wcprops 401B
all-wcprops 401B
all-wcprops 392B
all-wcprops 392B
all-wcprops 170B
all-wcprops 170B
all-wcprops 168B
all-wcprops 168B
all-wcprops 77B
all-wcprops 77B
all-wcprops 70B
all-wcprops 70B
all-wcprops 66B
all-wcprops 66B
all-wcprops 66B
all-wcprops 66B
all-wcprops 66B
all-wcprops 66B
COPYING 11KB
COPYING 11KB
calculator.cup 2KB
calculator.cup 2KB
entries 2KB
entries 2KB
entries 1KB
entries 1KB
entries 1KB
entries 1KB
entries 1013B
entries 1013B
entries 943B
entries 943B
entries 801B
entries 801B
entries 703B
entries 703B
entries 593B
entries 593B
entries 399B
entries 399B
entries 391B
entries 391B
entries 276B
entries 276B
entries 263B
entries 263B
entries 253B
entries 253B
entries 252B
entries 252B
entries 245B
entries 245B
parser.java 20KB
parser.java 20KB
Yylex.java 16KB
Yylex.java 16KB
CalculatorResultListView.java 5KB
CalculatorResultListView.java 5KB
PredefinedFunctions.java 4KB
PredefinedFunctions.java 4KB
EquationPlotterView.java 3KB
EquationPlotterView.java 3KB
InputTextView.java 3KB
InputTextView.java 3KB
Computer.java 3KB
Computer.java 3KB
EquationView.java 3KB
EquationView.java 3KB
CalculatorInputTextView.java 3KB
CalculatorInputTextView.java 3KB
ScientificCalculator.java 2KB
ScientificCalculator.java 2KB
ComputationUnit.java 2KB
ComputationUnit.java 2KB
EquationEditor.java 2KB
EquationEditor.java 2KB
Equation.java 2KB
Equation.java 2KB
EquationEditorView.java 2KB
EquationEditorView.java 2KB
ComputationUnitAdapter.java 2KB
ComputationUnitAdapter.java 2KB
EquationAdapter.java 2KB
EquationAdapter.java 2KB
Function.java 2KB
Function.java 2KB
InternalNode.java 2KB
InternalNode.java 2KB
共 256 条
- 1
- 2
- 3
资源评论
- wythe_ye2023-06-14内容与描述一致,超赞的资源,值得借鉴的内容很多,支持!
- m0_751013232023-01-12非常有用的资源,有一定的参考价值,受益匪浅,值得下载。
- 「已注销」2022-06-14用户下载后在一定时间内未进行评价,系统默认好评。
- m0_596714832022-11-15这个资源值得下载,资源内容详细全面,与描述一致,受益匪浅。
芝麻粒儿
- 粉丝: 5w+
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功