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

com.github.uscexp.blockformatpropertyfile.parser.AstStructTreeNode Maven / Gradle / Ivy

There is a newer version: 0.2.0-Beta
Show newest version
/*
 * Copyright (C) 2014 by haui - all rights reserved
 */
package com.github.uscexp.blockformatpropertyfile.parser;

import com.github.uscexp.blockformatpropertyfile.PropertyStruct;
import com.github.uscexp.grappa.extension.util.IStack;

/**
 * Command implementation for the PropertyFileParser rule: struct.
 */
public class AstStructTreeNode extends AstBaseCommandTreeNode {

	public AstStructTreeNode(String rule, String value) {
		super(rule, value);
	}

	@Override
	protected void interpretAfterChilds(Long id)
		throws Exception {
		super.interpretAfterChilds(id);
		IStack stack = processStore.getStack();
		String name = (String) stack.pop();
		PropertyStruct propertyStruct = (PropertyStruct) stack.pop();
		propertyStruct.setName(name);
		stack.push(propertyStruct);
	}

}