Adding track for ANTLR4 generated files

This commit is contained in:
romanman 2014-05-13 22:40:12 +03:00
parent 85c8b38b4e
commit f50703f69c
8 changed files with 4104 additions and 0 deletions

View File

@ -0,0 +1,66 @@
OP_IN_OR=37
EQ_OP=26
OP_AND=36
LINE_COMMENT=29
OP_LOG_OR=24
OP_ADD=32
T__20=1
OP_MUL=33
HEX_DIGIT=38
DEDENT=41
INT=30
T__9=12
T__8=13
T__7=14
INDENT=40
T__6=15
T__5=16
T__4=17
T__19=2
OP_EQ=35
WS=28
T__16=5
T__15=6
T__18=3
T__17=4
T__12=9
T__11=10
T__14=7
T__13=8
T__1=20
T__0=21
T__10=11
T__3=18
T__2=19
OP_EX_OR=22
VAR=31
OP_NOT=25
NL=27
HEX_NUMBER=39
OP_REL=34
OP_LOG_AND=23
'block.difficulty'=21
'|'=37
'block.number'=20
'block.prevhash'=19
'block.gaslimit'=18
'contract.balance'=17
'msg.value'=16
'block.timestamp'=15
'msg.sender'=14
'='=26
'return'=13
'elif'=12
'if'=11
':'=9
'('=10
'tx.gas'=6
'tx.origin'=7
'while'=8
'tx.gasprice'=4
'else:'=5
')'=3
'xor'=22
'msg.datasize'=1
'block.coinbase'=2
'&'=36

View File

@ -0,0 +1,481 @@
// Generated from E:\WorkingArea\ethereum\ethereumj\src\main\java\org\ethereum\serpent\Serpent.g4 by ANTLR 4.1
package org.ethereum.serpent;
import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.tree.ErrorNode;
import org.antlr.v4.runtime.tree.TerminalNode;
/**
* This class provides an empty implementation of {@link SerpentListener},
* which can be extended to create a listener which only needs to handle a subset
* of the available methods.
*/
public class SerpentBaseListener implements SerpentListener {
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterExpression(@NotNull SerpentParser.ExpressionContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitExpression(@NotNull SerpentParser.ExpressionContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterAssign(@NotNull SerpentParser.AssignContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitAssign(@NotNull SerpentParser.AssignContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterIf_elif_else_stmt(@NotNull SerpentParser.If_elif_else_stmtContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitIf_elif_else_stmt(@NotNull SerpentParser.If_elif_else_stmtContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterGet_var(@NotNull SerpentParser.Get_varContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitGet_var(@NotNull SerpentParser.Get_varContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterTx_origin(@NotNull SerpentParser.Tx_originContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitTx_origin(@NotNull SerpentParser.Tx_originContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterBlock(@NotNull SerpentParser.BlockContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitBlock(@NotNull SerpentParser.BlockContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterTx_gas(@NotNull SerpentParser.Tx_gasContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitTx_gas(@NotNull SerpentParser.Tx_gasContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterBlock_number(@NotNull SerpentParser.Block_numberContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitBlock_number(@NotNull SerpentParser.Block_numberContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterIn_or_exp(@NotNull SerpentParser.In_or_expContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitIn_or_exp(@NotNull SerpentParser.In_or_expContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterAdd_expr(@NotNull SerpentParser.Add_exprContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitAdd_expr(@NotNull SerpentParser.Add_exprContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterMsg_datasize(@NotNull SerpentParser.Msg_datasizeContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitMsg_datasize(@NotNull SerpentParser.Msg_datasizeContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterMsg_sender(@NotNull SerpentParser.Msg_senderContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitMsg_sender(@NotNull SerpentParser.Msg_senderContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterBlock_difficulty(@NotNull SerpentParser.Block_difficultyContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitBlock_difficulty(@NotNull SerpentParser.Block_difficultyContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterTx_gasprice(@NotNull SerpentParser.Tx_gaspriceContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitTx_gasprice(@NotNull SerpentParser.Tx_gaspriceContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterEx_or_exp(@NotNull SerpentParser.Ex_or_expContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitEx_or_exp(@NotNull SerpentParser.Ex_or_expContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterBlock_gaslimit(@NotNull SerpentParser.Block_gaslimitContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitBlock_gaslimit(@NotNull SerpentParser.Block_gaslimitContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterRel_exp(@NotNull SerpentParser.Rel_expContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitRel_exp(@NotNull SerpentParser.Rel_expContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterParse(@NotNull SerpentParser.ParseContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitParse(@NotNull SerpentParser.ParseContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterHex_num(@NotNull SerpentParser.Hex_numContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitHex_num(@NotNull SerpentParser.Hex_numContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterRet_func(@NotNull SerpentParser.Ret_funcContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitRet_func(@NotNull SerpentParser.Ret_funcContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterContract_balance(@NotNull SerpentParser.Contract_balanceContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitContract_balance(@NotNull SerpentParser.Contract_balanceContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterCondition(@NotNull SerpentParser.ConditionContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitCondition(@NotNull SerpentParser.ConditionContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterEq_exp(@NotNull SerpentParser.Eq_expContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitEq_exp(@NotNull SerpentParser.Eq_expContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterLog_and_exp(@NotNull SerpentParser.Log_and_expContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitLog_and_exp(@NotNull SerpentParser.Log_and_expContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterBlock_timestamp(@NotNull SerpentParser.Block_timestampContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitBlock_timestamp(@NotNull SerpentParser.Block_timestampContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterWhile_stmt(@NotNull SerpentParser.While_stmtContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitWhile_stmt(@NotNull SerpentParser.While_stmtContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterSpecial_func(@NotNull SerpentParser.Special_funcContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitSpecial_func(@NotNull SerpentParser.Special_funcContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterBlock_coinbase(@NotNull SerpentParser.Block_coinbaseContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitBlock_coinbase(@NotNull SerpentParser.Block_coinbaseContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterLog_or_exp(@NotNull SerpentParser.Log_or_expContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitLog_or_exp(@NotNull SerpentParser.Log_or_expContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterBlock_prevhash(@NotNull SerpentParser.Block_prevhashContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitBlock_prevhash(@NotNull SerpentParser.Block_prevhashContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterAnd_exp(@NotNull SerpentParser.And_expContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitAnd_exp(@NotNull SerpentParser.And_expContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterMul_expr(@NotNull SerpentParser.Mul_exprContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitMul_expr(@NotNull SerpentParser.Mul_exprContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterInt_val(@NotNull SerpentParser.Int_valContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitInt_val(@NotNull SerpentParser.Int_valContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterMsg_value(@NotNull SerpentParser.Msg_valueContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitMsg_value(@NotNull SerpentParser.Msg_valueContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void enterEveryRule(@NotNull ParserRuleContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void exitEveryRule(@NotNull ParserRuleContext ctx) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void visitTerminal(@NotNull TerminalNode node) { }
/**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/
@Override public void visitErrorNode(@NotNull ErrorNode node) { }
}

View File

@ -0,0 +1,286 @@
// Generated from E:\WorkingArea\ethereum\ethereumj\src\main\java\org\ethereum\serpent\Serpent.g4 by ANTLR 4.1
package org.ethereum.serpent;
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
/**
* This class provides an empty implementation of {@link SerpentVisitor},
* which can be extended to create a visitor which only needs to handle a subset
* of the available methods.
*
* @param <T> The return type of the visit operation. Use {@link Void} for
* operations with no return type.
*/
public class SerpentBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements SerpentVisitor<T> {
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitExpression(@NotNull SerpentParser.ExpressionContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitAssign(@NotNull SerpentParser.AssignContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitIf_elif_else_stmt(@NotNull SerpentParser.If_elif_else_stmtContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitGet_var(@NotNull SerpentParser.Get_varContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitTx_origin(@NotNull SerpentParser.Tx_originContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitBlock(@NotNull SerpentParser.BlockContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitTx_gas(@NotNull SerpentParser.Tx_gasContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitBlock_number(@NotNull SerpentParser.Block_numberContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitIn_or_exp(@NotNull SerpentParser.In_or_expContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitAdd_expr(@NotNull SerpentParser.Add_exprContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitMsg_datasize(@NotNull SerpentParser.Msg_datasizeContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitMsg_sender(@NotNull SerpentParser.Msg_senderContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitBlock_difficulty(@NotNull SerpentParser.Block_difficultyContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitTx_gasprice(@NotNull SerpentParser.Tx_gaspriceContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitEx_or_exp(@NotNull SerpentParser.Ex_or_expContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitBlock_gaslimit(@NotNull SerpentParser.Block_gaslimitContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitRel_exp(@NotNull SerpentParser.Rel_expContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitParse(@NotNull SerpentParser.ParseContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitHex_num(@NotNull SerpentParser.Hex_numContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitRet_func(@NotNull SerpentParser.Ret_funcContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitContract_balance(@NotNull SerpentParser.Contract_balanceContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitCondition(@NotNull SerpentParser.ConditionContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitEq_exp(@NotNull SerpentParser.Eq_expContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitLog_and_exp(@NotNull SerpentParser.Log_and_expContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitBlock_timestamp(@NotNull SerpentParser.Block_timestampContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitWhile_stmt(@NotNull SerpentParser.While_stmtContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitSpecial_func(@NotNull SerpentParser.Special_funcContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitBlock_coinbase(@NotNull SerpentParser.Block_coinbaseContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitLog_or_exp(@NotNull SerpentParser.Log_or_expContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitBlock_prevhash(@NotNull SerpentParser.Block_prevhashContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitAnd_exp(@NotNull SerpentParser.And_expContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitMul_expr(@NotNull SerpentParser.Mul_exprContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitInt_val(@NotNull SerpentParser.Int_valContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
* <p/>
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitMsg_value(@NotNull SerpentParser.Msg_valueContext ctx) { return visitChildren(ctx); }
}

View File

@ -0,0 +1,240 @@
// Generated from E:\WorkingArea\ethereum\ethereumj\src\main\java\org\ethereum\serpent\Serpent.g4 by ANTLR 4.1
package org.ethereum.serpent;
import com.yuvalshavit.antlr4.DenterHelper;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.TokenStream;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.misc.*;
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class SerpentLexer extends Lexer {
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
T__20=1, T__19=2, T__18=3, T__17=4, T__16=5, T__15=6, T__14=7, T__13=8,
T__12=9, T__11=10, T__10=11, T__9=12, T__8=13, T__7=14, T__6=15, T__5=16,
T__4=17, T__3=18, T__2=19, T__1=20, T__0=21, OP_EX_OR=22, OP_LOG_AND=23,
OP_LOG_OR=24, OP_NOT=25, EQ_OP=26, NL=27, WS=28, LINE_COMMENT=29, INT=30,
VAR=31, OP_ADD=32, OP_MUL=33, OP_REL=34, OP_EQ=35, OP_AND=36, OP_IN_OR=37,
HEX_DIGIT=38, HEX_NUMBER=39;
public static String[] modeNames = {
"DEFAULT_MODE"
};
public static final String[] tokenNames = {
"<INVALID>",
"'msg.datasize'", "'block.coinbase'", "')'", "'tx.gasprice'", "'else:'",
"'tx.gas'", "'tx.origin'", "'while'", "':'", "'('", "'if'", "'elif'",
"'return'", "'msg.sender'", "'block.timestamp'", "'msg.value'", "'contract.balance'",
"'block.gaslimit'", "'block.prevhash'", "'block.number'", "'block.difficulty'",
"'xor'", "OP_LOG_AND", "OP_LOG_OR", "OP_NOT", "'='", "NL", "WS", "LINE_COMMENT",
"INT", "VAR", "OP_ADD", "OP_MUL", "OP_REL", "OP_EQ", "'&'", "'|'", "HEX_DIGIT",
"HEX_NUMBER"
};
public static final String[] ruleNames = {
"T__20", "T__19", "T__18", "T__17", "T__16", "T__15", "T__14", "T__13",
"T__12", "T__11", "T__10", "T__9", "T__8", "T__7", "T__6", "T__5", "T__4",
"T__3", "T__2", "T__1", "T__0", "OP_EX_OR", "OP_LOG_AND", "OP_LOG_OR",
"OP_NOT", "EQ_OP", "NL", "WS", "LINE_COMMENT", "INT", "VAR", "OP_ADD",
"OP_MUL", "OP_REL", "OP_EQ", "OP_AND", "OP_IN_OR", "HEX_DIGIT", "HEX_NUMBER"
};
private final DenterHelper denter = new DenterHelper(NL, SerpentParser.INDENT, SerpentParser.DEDENT) {
@Override
public Token pullToken() {
return SerpentLexer.super.nextToken(); // must be to super.nextToken, or we'll recurse forever!
}
};
@Override
public Token nextToken() {
return denter.nextToken();
}
public SerpentLexer(CharStream input) {
super(input);
_interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
@Override
public String getGrammarFileName() { return "Serpent.g4"; }
@Override
public String[] getTokenNames() { return tokenNames; }
@Override
public String[] getRuleNames() { return ruleNames; }
@Override
public String[] getModeNames() { return modeNames; }
@Override
public ATN getATN() { return _ATN; }
@Override
public void action(RuleContext _localctx, int ruleIndex, int actionIndex) {
switch (ruleIndex) {
case 27: WS_action((RuleContext)_localctx, actionIndex); break;
case 28: LINE_COMMENT_action((RuleContext)_localctx, actionIndex); break;
}
}
private void WS_action(RuleContext _localctx, int actionIndex) {
switch (actionIndex) {
case 0: skip(); break;
}
}
private void LINE_COMMENT_action(RuleContext _localctx, int actionIndex) {
switch (actionIndex) {
case 1: skip(); break;
}
}
public static final String _serializedATN =
"\3\uacf5\uee8c\u4f5d\u8b0d\u4a45\u78bd\u1b2f\u3378\2)\u0180\b\1\4\2\t"+
"\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+
"\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+
"\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+
"\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!"+
"\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\3\2\3\2\3\2\3\2\3\2"+
"\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3"+
"\3\3\3\3\3\3\3\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5"+
"\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3"+
"\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\13\3"+
"\13\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\16"+
"\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\20\3\20\3\20"+
"\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\21"+
"\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\22\3\22\3\22"+
"\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\23\3\23"+
"\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\24"+
"\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24"+
"\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\26"+
"\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26"+
"\3\26\3\26\3\27\3\27\3\27\3\27\3\30\3\30\3\30\3\30\3\30\5\30\u0127\n\30"+
"\3\31\3\31\3\31\3\31\5\31\u012d\n\31\3\32\3\32\3\32\3\32\5\32\u0133\n"+
"\32\3\33\3\33\3\34\5\34\u0138\n\34\3\34\3\34\7\34\u013c\n\34\f\34\16\34"+
"\u013f\13\34\3\35\6\35\u0142\n\35\r\35\16\35\u0143\3\35\3\35\3\36\3\36"+
"\3\36\3\36\7\36\u014c\n\36\f\36\16\36\u014f\13\36\3\36\3\36\3\37\6\37"+
"\u0154\n\37\r\37\16\37\u0155\3 \3 \7 \u015a\n \f \16 \u015d\13 \3!\3!"+
"\3\"\3\"\3#\3#\3#\3#\3#\5#\u0168\n#\3$\3$\3$\3$\5$\u016e\n$\3%\3%\3&\3"+
"&\3\'\3\'\3(\3(\3(\3(\5(\u017a\n(\3(\6(\u017d\n(\r(\16(\u017e\2)\3\3\1"+
"\5\4\1\7\5\1\t\6\1\13\7\1\r\b\1\17\t\1\21\n\1\23\13\1\25\f\1\27\r\1\31"+
"\16\1\33\17\1\35\20\1\37\21\1!\22\1#\23\1%\24\1\'\25\1)\26\1+\27\1-\30"+
"\1/\31\1\61\32\1\63\33\1\65\34\1\67\35\19\36\2;\37\3= \1?!\1A\"\1C#\1"+
"E$\1G%\1I&\1K\'\1M(\1O)\1\3\2\13\4\2\13\13\"\"\4\2\f\f\17\17\3\2\62;\4"+
"\2C\\c|\5\2\62;C\\c|\4\2--//\6\2\'\',,\61\61``\4\2>>@@\5\2\62;CHch\u018d"+
"\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2"+
"\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2"+
"\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2"+
"\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2"+
"\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3"+
"\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2"+
"\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\3Q\3\2\2\2\5^\3\2\2\2\7"+
"m\3\2\2\2\to\3\2\2\2\13{\3\2\2\2\r\u0081\3\2\2\2\17\u0088\3\2\2\2\21\u0092"+
"\3\2\2\2\23\u0098\3\2\2\2\25\u009a\3\2\2\2\27\u009c\3\2\2\2\31\u009f\3"+
"\2\2\2\33\u00a4\3\2\2\2\35\u00ab\3\2\2\2\37\u00b6\3\2\2\2!\u00c6\3\2\2"+
"\2#\u00d0\3\2\2\2%\u00e1\3\2\2\2\'\u00f0\3\2\2\2)\u00ff\3\2\2\2+\u010c"+
"\3\2\2\2-\u011d\3\2\2\2/\u0126\3\2\2\2\61\u012c\3\2\2\2\63\u0132\3\2\2"+
"\2\65\u0134\3\2\2\2\67\u0137\3\2\2\29\u0141\3\2\2\2;\u0147\3\2\2\2=\u0153"+
"\3\2\2\2?\u0157\3\2\2\2A\u015e\3\2\2\2C\u0160\3\2\2\2E\u0167\3\2\2\2G"+
"\u016d\3\2\2\2I\u016f\3\2\2\2K\u0171\3\2\2\2M\u0173\3\2\2\2O\u0179\3\2"+
"\2\2QR\7o\2\2RS\7u\2\2ST\7i\2\2TU\7\60\2\2UV\7f\2\2VW\7c\2\2WX\7v\2\2"+
"XY\7c\2\2YZ\7u\2\2Z[\7k\2\2[\\\7|\2\2\\]\7g\2\2]\4\3\2\2\2^_\7d\2\2_`"+
"\7n\2\2`a\7q\2\2ab\7e\2\2bc\7m\2\2cd\7\60\2\2de\7e\2\2ef\7q\2\2fg\7k\2"+
"\2gh\7p\2\2hi\7d\2\2ij\7c\2\2jk\7u\2\2kl\7g\2\2l\6\3\2\2\2mn\7+\2\2n\b"+
"\3\2\2\2op\7v\2\2pq\7z\2\2qr\7\60\2\2rs\7i\2\2st\7c\2\2tu\7u\2\2uv\7r"+
"\2\2vw\7t\2\2wx\7k\2\2xy\7e\2\2yz\7g\2\2z\n\3\2\2\2{|\7g\2\2|}\7n\2\2"+
"}~\7u\2\2~\177\7g\2\2\177\u0080\7<\2\2\u0080\f\3\2\2\2\u0081\u0082\7v"+
"\2\2\u0082\u0083\7z\2\2\u0083\u0084\7\60\2\2\u0084\u0085\7i\2\2\u0085"+
"\u0086\7c\2\2\u0086\u0087\7u\2\2\u0087\16\3\2\2\2\u0088\u0089\7v\2\2\u0089"+
"\u008a\7z\2\2\u008a\u008b\7\60\2\2\u008b\u008c\7q\2\2\u008c\u008d\7t\2"+
"\2\u008d\u008e\7k\2\2\u008e\u008f\7i\2\2\u008f\u0090\7k\2\2\u0090\u0091"+
"\7p\2\2\u0091\20\3\2\2\2\u0092\u0093\7y\2\2\u0093\u0094\7j\2\2\u0094\u0095"+
"\7k\2\2\u0095\u0096\7n\2\2\u0096\u0097\7g\2\2\u0097\22\3\2\2\2\u0098\u0099"+
"\7<\2\2\u0099\24\3\2\2\2\u009a\u009b\7*\2\2\u009b\26\3\2\2\2\u009c\u009d"+
"\7k\2\2\u009d\u009e\7h\2\2\u009e\30\3\2\2\2\u009f\u00a0\7g\2\2\u00a0\u00a1"+
"\7n\2\2\u00a1\u00a2\7k\2\2\u00a2\u00a3\7h\2\2\u00a3\32\3\2\2\2\u00a4\u00a5"+
"\7t\2\2\u00a5\u00a6\7g\2\2\u00a6\u00a7\7v\2\2\u00a7\u00a8\7w\2\2\u00a8"+
"\u00a9\7t\2\2\u00a9\u00aa\7p\2\2\u00aa\34\3\2\2\2\u00ab\u00ac\7o\2\2\u00ac"+
"\u00ad\7u\2\2\u00ad\u00ae\7i\2\2\u00ae\u00af\7\60\2\2\u00af\u00b0\7u\2"+
"\2\u00b0\u00b1\7g\2\2\u00b1\u00b2\7p\2\2\u00b2\u00b3\7f\2\2\u00b3\u00b4"+
"\7g\2\2\u00b4\u00b5\7t\2\2\u00b5\36\3\2\2\2\u00b6\u00b7\7d\2\2\u00b7\u00b8"+
"\7n\2\2\u00b8\u00b9\7q\2\2\u00b9\u00ba\7e\2\2\u00ba\u00bb\7m\2\2\u00bb"+
"\u00bc\7\60\2\2\u00bc\u00bd\7v\2\2\u00bd\u00be\7k\2\2\u00be\u00bf\7o\2"+
"\2\u00bf\u00c0\7g\2\2\u00c0\u00c1\7u\2\2\u00c1\u00c2\7v\2\2\u00c2\u00c3"+
"\7c\2\2\u00c3\u00c4\7o\2\2\u00c4\u00c5\7r\2\2\u00c5 \3\2\2\2\u00c6\u00c7"+
"\7o\2\2\u00c7\u00c8\7u\2\2\u00c8\u00c9\7i\2\2\u00c9\u00ca\7\60\2\2\u00ca"+
"\u00cb\7x\2\2\u00cb\u00cc\7c\2\2\u00cc\u00cd\7n\2\2\u00cd\u00ce\7w\2\2"+
"\u00ce\u00cf\7g\2\2\u00cf\"\3\2\2\2\u00d0\u00d1\7e\2\2\u00d1\u00d2\7q"+
"\2\2\u00d2\u00d3\7p\2\2\u00d3\u00d4\7v\2\2\u00d4\u00d5\7t\2\2\u00d5\u00d6"+
"\7c\2\2\u00d6\u00d7\7e\2\2\u00d7\u00d8\7v\2\2\u00d8\u00d9\7\60\2\2\u00d9"+
"\u00da\7d\2\2\u00da\u00db\7c\2\2\u00db\u00dc\7n\2\2\u00dc\u00dd\7c\2\2"+
"\u00dd\u00de\7p\2\2\u00de\u00df\7e\2\2\u00df\u00e0\7g\2\2\u00e0$\3\2\2"+
"\2\u00e1\u00e2\7d\2\2\u00e2\u00e3\7n\2\2\u00e3\u00e4\7q\2\2\u00e4\u00e5"+
"\7e\2\2\u00e5\u00e6\7m\2\2\u00e6\u00e7\7\60\2\2\u00e7\u00e8\7i\2\2\u00e8"+
"\u00e9\7c\2\2\u00e9\u00ea\7u\2\2\u00ea\u00eb\7n\2\2\u00eb\u00ec\7k\2\2"+
"\u00ec\u00ed\7o\2\2\u00ed\u00ee\7k\2\2\u00ee\u00ef\7v\2\2\u00ef&\3\2\2"+
"\2\u00f0\u00f1\7d\2\2\u00f1\u00f2\7n\2\2\u00f2\u00f3\7q\2\2\u00f3\u00f4"+
"\7e\2\2\u00f4\u00f5\7m\2\2\u00f5\u00f6\7\60\2\2\u00f6\u00f7\7r\2\2\u00f7"+
"\u00f8\7t\2\2\u00f8\u00f9\7g\2\2\u00f9\u00fa\7x\2\2\u00fa\u00fb\7j\2\2"+
"\u00fb\u00fc\7c\2\2\u00fc\u00fd\7u\2\2\u00fd\u00fe\7j\2\2\u00fe(\3\2\2"+
"\2\u00ff\u0100\7d\2\2\u0100\u0101\7n\2\2\u0101\u0102\7q\2\2\u0102\u0103"+
"\7e\2\2\u0103\u0104\7m\2\2\u0104\u0105\7\60\2\2\u0105\u0106\7p\2\2\u0106"+
"\u0107\7w\2\2\u0107\u0108\7o\2\2\u0108\u0109\7d\2\2\u0109\u010a\7g\2\2"+
"\u010a\u010b\7t\2\2\u010b*\3\2\2\2\u010c\u010d\7d\2\2\u010d\u010e\7n\2"+
"\2\u010e\u010f\7q\2\2\u010f\u0110\7e\2\2\u0110\u0111\7m\2\2\u0111\u0112"+
"\7\60\2\2\u0112\u0113\7f\2\2\u0113\u0114\7k\2\2\u0114\u0115\7h\2\2\u0115"+
"\u0116\7h\2\2\u0116\u0117\7k\2\2\u0117\u0118\7e\2\2\u0118\u0119\7w\2\2"+
"\u0119\u011a\7n\2\2\u011a\u011b\7v\2\2\u011b\u011c\7{\2\2\u011c,\3\2\2"+
"\2\u011d\u011e\7z\2\2\u011e\u011f\7q\2\2\u011f\u0120\7t\2\2\u0120.\3\2"+
"\2\2\u0121\u0122\7(\2\2\u0122\u0127\7(\2\2\u0123\u0124\7c\2\2\u0124\u0125"+
"\7p\2\2\u0125\u0127\7f\2\2\u0126\u0121\3\2\2\2\u0126\u0123\3\2\2\2\u0127"+
"\60\3\2\2\2\u0128\u0129\7~\2\2\u0129\u012d\7~\2\2\u012a\u012b\7q\2\2\u012b"+
"\u012d\7t\2\2\u012c\u0128\3\2\2\2\u012c\u012a\3\2\2\2\u012d\62\3\2\2\2"+
"\u012e\u0133\7#\2\2\u012f\u0130\7p\2\2\u0130\u0131\7q\2\2\u0131\u0133"+
"\7v\2\2\u0132\u012e\3\2\2\2\u0132\u012f\3\2\2\2\u0133\64\3\2\2\2\u0134"+
"\u0135\7?\2\2\u0135\66\3\2\2\2\u0136\u0138\7\17\2\2\u0137\u0136\3\2\2"+
"\2\u0137\u0138\3\2\2\2\u0138\u0139\3\2\2\2\u0139\u013d\7\f\2\2\u013a\u013c"+
"\7\"\2\2\u013b\u013a\3\2\2\2\u013c\u013f\3\2\2\2\u013d\u013b\3\2\2\2\u013d"+
"\u013e\3\2\2\2\u013e8\3\2\2\2\u013f\u013d\3\2\2\2\u0140\u0142\t\2\2\2"+
"\u0141\u0140\3\2\2\2\u0142\u0143\3\2\2\2\u0143\u0141\3\2\2\2\u0143\u0144"+
"\3\2\2\2\u0144\u0145\3\2\2\2\u0145\u0146\b\35\2\2\u0146:\3\2\2\2\u0147"+
"\u0148\7\61\2\2\u0148\u0149\7\61\2\2\u0149\u014d\3\2\2\2\u014a\u014c\n"+
"\3\2\2\u014b\u014a\3\2\2\2\u014c\u014f\3\2\2\2\u014d\u014b\3\2\2\2\u014d"+
"\u014e\3\2\2\2\u014e\u0150\3\2\2\2\u014f\u014d\3\2\2\2\u0150\u0151\b\36"+
"\3\2\u0151<\3\2\2\2\u0152\u0154\t\4\2\2\u0153\u0152\3\2\2\2\u0154\u0155"+
"\3\2\2\2\u0155\u0153\3\2\2\2\u0155\u0156\3\2\2\2\u0156>\3\2\2\2\u0157"+
"\u015b\t\5\2\2\u0158\u015a\t\6\2\2\u0159\u0158\3\2\2\2\u015a\u015d\3\2"+
"\2\2\u015b\u0159\3\2\2\2\u015b\u015c\3\2\2\2\u015c@\3\2\2\2\u015d\u015b"+
"\3\2\2\2\u015e\u015f\t\7\2\2\u015fB\3\2\2\2\u0160\u0161\t\b\2\2\u0161"+
"D\3\2\2\2\u0162\u0168\t\t\2\2\u0163\u0164\7>\2\2\u0164\u0168\7?\2\2\u0165"+
"\u0166\7@\2\2\u0166\u0168\7?\2\2\u0167\u0162\3\2\2\2\u0167\u0163\3\2\2"+
"\2\u0167\u0165\3\2\2\2\u0168F\3\2\2\2\u0169\u016a\7?\2\2\u016a\u016e\7"+
"?\2\2\u016b\u016c\7#\2\2\u016c\u016e\7?\2\2\u016d\u0169\3\2\2\2\u016d"+
"\u016b\3\2\2\2\u016eH\3\2\2\2\u016f\u0170\7(\2\2\u0170J\3\2\2\2\u0171"+
"\u0172\7~\2\2\u0172L\3\2\2\2\u0173\u0174\t\n\2\2\u0174N\3\2\2\2\u0175"+
"\u0176\7\62\2\2\u0176\u017a\7z\2\2\u0177\u0178\7\62\2\2\u0178\u017a\7"+
"Z\2\2\u0179\u0175\3\2\2\2\u0179\u0177\3\2\2\2\u017a\u017c\3\2\2\2\u017b"+
"\u017d\5M\'\2\u017c\u017b\3\2\2\2\u017d\u017e\3\2\2\2\u017e\u017c\3\2"+
"\2\2\u017e\u017f\3\2\2\2\u017fP\3\2\2\2\20\2\u0126\u012c\u0132\u0137\u013d"+
"\u0143\u014d\u0155\u015b\u0167\u016d\u0179\u017e";
public static final ATN _ATN =
ATNSimulator.deserialize(_serializedATN.toCharArray());
static {
_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
_decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
}
}
}

View File

@ -0,0 +1,64 @@
OP_IN_OR=37
EQ_OP=26
OP_AND=36
LINE_COMMENT=29
OP_LOG_OR=24
OP_ADD=32
T__20=1
OP_MUL=33
HEX_DIGIT=38
INT=30
T__9=12
T__8=13
T__7=14
T__6=15
T__5=16
T__4=17
T__19=2
OP_EQ=35
WS=28
T__16=5
T__15=6
T__18=3
T__17=4
T__12=9
T__11=10
T__14=7
T__13=8
T__1=20
T__0=21
T__10=11
T__3=18
T__2=19
OP_EX_OR=22
VAR=31
OP_NOT=25
NL=27
HEX_NUMBER=39
OP_REL=34
OP_LOG_AND=23
'block.difficulty'=21
'|'=37
'block.number'=20
'block.prevhash'=19
'block.gaslimit'=18
'contract.balance'=17
'msg.value'=16
'block.timestamp'=15
'msg.sender'=14
'='=26
'return'=13
'elif'=12
'if'=11
':'=9
'('=10
'tx.gas'=6
'tx.origin'=7
'while'=8
'tx.gasprice'=4
'else:'=5
')'=3
'xor'=22
'msg.datasize'=1
'block.coinbase'=2
'&'=36

View File

@ -0,0 +1,384 @@
// Generated from E:\WorkingArea\ethereum\ethereumj\src\main\java\org\ethereum\serpent\Serpent.g4 by ANTLR 4.1
package org.ethereum.serpent;
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.tree.ParseTreeListener;
/**
* This interface defines a complete listener for a parse tree produced by
* {@link SerpentParser}.
*/
public interface SerpentListener extends ParseTreeListener {
/**
* Enter a parse tree produced by {@link SerpentParser#expression}.
* @param ctx the parse tree
*/
void enterExpression(@NotNull SerpentParser.ExpressionContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#expression}.
* @param ctx the parse tree
*/
void exitExpression(@NotNull SerpentParser.ExpressionContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#assign}.
* @param ctx the parse tree
*/
void enterAssign(@NotNull SerpentParser.AssignContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#assign}.
* @param ctx the parse tree
*/
void exitAssign(@NotNull SerpentParser.AssignContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#if_elif_else_stmt}.
* @param ctx the parse tree
*/
void enterIf_elif_else_stmt(@NotNull SerpentParser.If_elif_else_stmtContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#if_elif_else_stmt}.
* @param ctx the parse tree
*/
void exitIf_elif_else_stmt(@NotNull SerpentParser.If_elif_else_stmtContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#get_var}.
* @param ctx the parse tree
*/
void enterGet_var(@NotNull SerpentParser.Get_varContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#get_var}.
* @param ctx the parse tree
*/
void exitGet_var(@NotNull SerpentParser.Get_varContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#tx_origin}.
* @param ctx the parse tree
*/
void enterTx_origin(@NotNull SerpentParser.Tx_originContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#tx_origin}.
* @param ctx the parse tree
*/
void exitTx_origin(@NotNull SerpentParser.Tx_originContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#block}.
* @param ctx the parse tree
*/
void enterBlock(@NotNull SerpentParser.BlockContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#block}.
* @param ctx the parse tree
*/
void exitBlock(@NotNull SerpentParser.BlockContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#tx_gas}.
* @param ctx the parse tree
*/
void enterTx_gas(@NotNull SerpentParser.Tx_gasContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#tx_gas}.
* @param ctx the parse tree
*/
void exitTx_gas(@NotNull SerpentParser.Tx_gasContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#block_number}.
* @param ctx the parse tree
*/
void enterBlock_number(@NotNull SerpentParser.Block_numberContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#block_number}.
* @param ctx the parse tree
*/
void exitBlock_number(@NotNull SerpentParser.Block_numberContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#in_or_exp}.
* @param ctx the parse tree
*/
void enterIn_or_exp(@NotNull SerpentParser.In_or_expContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#in_or_exp}.
* @param ctx the parse tree
*/
void exitIn_or_exp(@NotNull SerpentParser.In_or_expContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#add_expr}.
* @param ctx the parse tree
*/
void enterAdd_expr(@NotNull SerpentParser.Add_exprContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#add_expr}.
* @param ctx the parse tree
*/
void exitAdd_expr(@NotNull SerpentParser.Add_exprContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#msg_datasize}.
* @param ctx the parse tree
*/
void enterMsg_datasize(@NotNull SerpentParser.Msg_datasizeContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#msg_datasize}.
* @param ctx the parse tree
*/
void exitMsg_datasize(@NotNull SerpentParser.Msg_datasizeContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#msg_sender}.
* @param ctx the parse tree
*/
void enterMsg_sender(@NotNull SerpentParser.Msg_senderContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#msg_sender}.
* @param ctx the parse tree
*/
void exitMsg_sender(@NotNull SerpentParser.Msg_senderContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#block_difficulty}.
* @param ctx the parse tree
*/
void enterBlock_difficulty(@NotNull SerpentParser.Block_difficultyContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#block_difficulty}.
* @param ctx the parse tree
*/
void exitBlock_difficulty(@NotNull SerpentParser.Block_difficultyContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#tx_gasprice}.
* @param ctx the parse tree
*/
void enterTx_gasprice(@NotNull SerpentParser.Tx_gaspriceContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#tx_gasprice}.
* @param ctx the parse tree
*/
void exitTx_gasprice(@NotNull SerpentParser.Tx_gaspriceContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#ex_or_exp}.
* @param ctx the parse tree
*/
void enterEx_or_exp(@NotNull SerpentParser.Ex_or_expContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#ex_or_exp}.
* @param ctx the parse tree
*/
void exitEx_or_exp(@NotNull SerpentParser.Ex_or_expContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#block_gaslimit}.
* @param ctx the parse tree
*/
void enterBlock_gaslimit(@NotNull SerpentParser.Block_gaslimitContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#block_gaslimit}.
* @param ctx the parse tree
*/
void exitBlock_gaslimit(@NotNull SerpentParser.Block_gaslimitContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#rel_exp}.
* @param ctx the parse tree
*/
void enterRel_exp(@NotNull SerpentParser.Rel_expContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#rel_exp}.
* @param ctx the parse tree
*/
void exitRel_exp(@NotNull SerpentParser.Rel_expContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#parse}.
* @param ctx the parse tree
*/
void enterParse(@NotNull SerpentParser.ParseContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#parse}.
* @param ctx the parse tree
*/
void exitParse(@NotNull SerpentParser.ParseContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#hex_num}.
* @param ctx the parse tree
*/
void enterHex_num(@NotNull SerpentParser.Hex_numContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#hex_num}.
* @param ctx the parse tree
*/
void exitHex_num(@NotNull SerpentParser.Hex_numContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#ret_func}.
* @param ctx the parse tree
*/
void enterRet_func(@NotNull SerpentParser.Ret_funcContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#ret_func}.
* @param ctx the parse tree
*/
void exitRet_func(@NotNull SerpentParser.Ret_funcContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#contract_balance}.
* @param ctx the parse tree
*/
void enterContract_balance(@NotNull SerpentParser.Contract_balanceContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#contract_balance}.
* @param ctx the parse tree
*/
void exitContract_balance(@NotNull SerpentParser.Contract_balanceContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#condition}.
* @param ctx the parse tree
*/
void enterCondition(@NotNull SerpentParser.ConditionContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#condition}.
* @param ctx the parse tree
*/
void exitCondition(@NotNull SerpentParser.ConditionContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#eq_exp}.
* @param ctx the parse tree
*/
void enterEq_exp(@NotNull SerpentParser.Eq_expContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#eq_exp}.
* @param ctx the parse tree
*/
void exitEq_exp(@NotNull SerpentParser.Eq_expContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#log_and_exp}.
* @param ctx the parse tree
*/
void enterLog_and_exp(@NotNull SerpentParser.Log_and_expContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#log_and_exp}.
* @param ctx the parse tree
*/
void exitLog_and_exp(@NotNull SerpentParser.Log_and_expContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#block_timestamp}.
* @param ctx the parse tree
*/
void enterBlock_timestamp(@NotNull SerpentParser.Block_timestampContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#block_timestamp}.
* @param ctx the parse tree
*/
void exitBlock_timestamp(@NotNull SerpentParser.Block_timestampContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#while_stmt}.
* @param ctx the parse tree
*/
void enterWhile_stmt(@NotNull SerpentParser.While_stmtContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#while_stmt}.
* @param ctx the parse tree
*/
void exitWhile_stmt(@NotNull SerpentParser.While_stmtContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#special_func}.
* @param ctx the parse tree
*/
void enterSpecial_func(@NotNull SerpentParser.Special_funcContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#special_func}.
* @param ctx the parse tree
*/
void exitSpecial_func(@NotNull SerpentParser.Special_funcContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#block_coinbase}.
* @param ctx the parse tree
*/
void enterBlock_coinbase(@NotNull SerpentParser.Block_coinbaseContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#block_coinbase}.
* @param ctx the parse tree
*/
void exitBlock_coinbase(@NotNull SerpentParser.Block_coinbaseContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#log_or_exp}.
* @param ctx the parse tree
*/
void enterLog_or_exp(@NotNull SerpentParser.Log_or_expContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#log_or_exp}.
* @param ctx the parse tree
*/
void exitLog_or_exp(@NotNull SerpentParser.Log_or_expContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#block_prevhash}.
* @param ctx the parse tree
*/
void enterBlock_prevhash(@NotNull SerpentParser.Block_prevhashContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#block_prevhash}.
* @param ctx the parse tree
*/
void exitBlock_prevhash(@NotNull SerpentParser.Block_prevhashContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#and_exp}.
* @param ctx the parse tree
*/
void enterAnd_exp(@NotNull SerpentParser.And_expContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#and_exp}.
* @param ctx the parse tree
*/
void exitAnd_exp(@NotNull SerpentParser.And_expContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#mul_expr}.
* @param ctx the parse tree
*/
void enterMul_expr(@NotNull SerpentParser.Mul_exprContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#mul_expr}.
* @param ctx the parse tree
*/
void exitMul_expr(@NotNull SerpentParser.Mul_exprContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#int_val}.
* @param ctx the parse tree
*/
void enterInt_val(@NotNull SerpentParser.Int_valContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#int_val}.
* @param ctx the parse tree
*/
void exitInt_val(@NotNull SerpentParser.Int_valContext ctx);
/**
* Enter a parse tree produced by {@link SerpentParser#msg_value}.
* @param ctx the parse tree
*/
void enterMsg_value(@NotNull SerpentParser.Msg_valueContext ctx);
/**
* Exit a parse tree produced by {@link SerpentParser#msg_value}.
* @param ctx the parse tree
*/
void exitMsg_value(@NotNull SerpentParser.Msg_valueContext ctx);
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,251 @@
// Generated from E:\WorkingArea\ethereum\ethereumj\src\main\java\org\ethereum\serpent\Serpent.g4 by ANTLR 4.1
package org.ethereum.serpent;
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
/**
* This interface defines a complete generic visitor for a parse tree produced
* by {@link SerpentParser}.
*
* @param <T> The return type of the visit operation. Use {@link Void} for
* operations with no return type.
*/
public interface SerpentVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link SerpentParser#expression}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitExpression(@NotNull SerpentParser.ExpressionContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#assign}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitAssign(@NotNull SerpentParser.AssignContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#if_elif_else_stmt}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitIf_elif_else_stmt(@NotNull SerpentParser.If_elif_else_stmtContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#get_var}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitGet_var(@NotNull SerpentParser.Get_varContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#tx_origin}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTx_origin(@NotNull SerpentParser.Tx_originContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#block}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitBlock(@NotNull SerpentParser.BlockContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#tx_gas}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTx_gas(@NotNull SerpentParser.Tx_gasContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#block_number}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitBlock_number(@NotNull SerpentParser.Block_numberContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#in_or_exp}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitIn_or_exp(@NotNull SerpentParser.In_or_expContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#add_expr}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitAdd_expr(@NotNull SerpentParser.Add_exprContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#msg_datasize}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitMsg_datasize(@NotNull SerpentParser.Msg_datasizeContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#msg_sender}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitMsg_sender(@NotNull SerpentParser.Msg_senderContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#block_difficulty}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitBlock_difficulty(@NotNull SerpentParser.Block_difficultyContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#tx_gasprice}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitTx_gasprice(@NotNull SerpentParser.Tx_gaspriceContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#ex_or_exp}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitEx_or_exp(@NotNull SerpentParser.Ex_or_expContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#block_gaslimit}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitBlock_gaslimit(@NotNull SerpentParser.Block_gaslimitContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#rel_exp}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitRel_exp(@NotNull SerpentParser.Rel_expContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#parse}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitParse(@NotNull SerpentParser.ParseContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#hex_num}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitHex_num(@NotNull SerpentParser.Hex_numContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#ret_func}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitRet_func(@NotNull SerpentParser.Ret_funcContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#contract_balance}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitContract_balance(@NotNull SerpentParser.Contract_balanceContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#condition}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitCondition(@NotNull SerpentParser.ConditionContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#eq_exp}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitEq_exp(@NotNull SerpentParser.Eq_expContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#log_and_exp}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitLog_and_exp(@NotNull SerpentParser.Log_and_expContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#block_timestamp}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitBlock_timestamp(@NotNull SerpentParser.Block_timestampContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#while_stmt}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitWhile_stmt(@NotNull SerpentParser.While_stmtContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#special_func}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitSpecial_func(@NotNull SerpentParser.Special_funcContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#block_coinbase}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitBlock_coinbase(@NotNull SerpentParser.Block_coinbaseContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#log_or_exp}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitLog_or_exp(@NotNull SerpentParser.Log_or_expContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#block_prevhash}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitBlock_prevhash(@NotNull SerpentParser.Block_prevhashContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#and_exp}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitAnd_exp(@NotNull SerpentParser.And_expContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#mul_expr}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitMul_expr(@NotNull SerpentParser.Mul_exprContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#int_val}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitInt_val(@NotNull SerpentParser.Int_valContext ctx);
/**
* Visit a parse tree produced by {@link SerpentParser#msg_value}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitMsg_value(@NotNull SerpentParser.Msg_valueContext ctx);
}