Sha256: 73490bf4150b95ec00559b921746da2742d5d1a4a0349f349e70520997ca8e5e
Contents?: true
Size: 717 Bytes
Versions: 135
Compression:
Stored size: 717 Bytes
Contents
/** * Copyright 2005-2007 Xue Yong Zhi * Distributed under the BSD License */ package com.xruby.compiler.parser; import java.util.ArrayList; class SymbolTable { private final ArrayList<String> variables_ = new ArrayList<String>(); public void addVariable(String s) { variables_.add(s); } public boolean findVariable(String s) { return variables_.indexOf(s) >= 0; } } class SymbolTableForBlock extends SymbolTable { private SymbolTable owner_; public SymbolTableForBlock(SymbolTable owner) { owner_ = owner; } public boolean findVariable(String s) { if (super.findVariable(s)) { return true; } else { return owner_.findVariable(s); } } }
Version data entries
135 entries across 135 versions & 2 rubygems