コード例 #1
0
		protected override void TranslateVariable(List<string> output, Variable expr)
		{
			output.Add(this.GetVariableName(expr.Name));
		}
コード例 #2
0
ファイル: ByteCodeCompiler.cs プロジェクト: geofrey/crayon
		private void CompileVariable(Parser parser, ByteBuffer buffer, Variable variable, bool outputUsed)
		{
			if (!outputUsed) throw new ParserException(variable.FirstToken, "This expression does nothing.");
			int nameId = parser.GetId(variable.Name);
			Token token = variable.FirstToken;
			if (variable.LocalScopeId == -1)
			{
				throw new ParserException(token, "Variable used but not declared.");
			}
			else
			{
				buffer.Add(token, OpCode.LOCAL, variable.LocalScopeId, nameId);
			}
		}
コード例 #3
0
ファイル: AbstractTranslator.cs プロジェクト: geofrey/crayon
		protected abstract void TranslateVariable(List<string> output, Variable expr);