All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cfml.parsing.cfscript.CFMember Maven / Gradle / Ivy

There is a newer version: 2.11.0
Show newest version
package cfml.parsing.cfscript;

import java.util.List;

import org.antlr.v4.runtime.Token;

import cfml.parsing.cfscript.script.CFScriptStatement;
import cfml.parsing.util.ArrayBuilder;

public class CFMember extends CFExpression implements java.io.Serializable {
	private static final long serialVersionUID = 1L;
	
	protected Token token;
	
	private CFExpression expression;
	
	public CFMember(Token _t, CFExpression expr) {
		super(_t);
		token = _t;
		expression = expr;
		if (expression != null) {
			expression.setParent(this);
		}
	}
	
	@Override
	public byte getType() {
		return CFExpression.ARRAYMEMBER;
	}
	
	@Override
	public Token getToken() {
		return token;
	}
	
	@Override
	public String Decompile(int indent) {
		return "[" + expression.Decompile(0) + "]";
	}
	
	@Override
	public String toString() {
		return Decompile(0);
	}
	
	public CFExpression getExpression() {
		return expression;
	}
	
	@Override
	public List decomposeExpression() {
		return ArrayBuilder.createCFExpression(expression);
	}
	
	@Override
	public List decomposeScript() {
		return ArrayBuilder.createCFScriptStatement();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy