summaryrefslogtreecommitdiff
path: root/src/main/java/bjc/rgens/parser/templates/TemplateElement.java
blob: effd964675b2cd86eec4ddc07fbbe26b18193d37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package bjc.rgens.parser.templates;

import bjc.rgens.parser.GenerationState;

/**
 * Abstract element of a template.
 * 
 * @author Ben Culkin
 *
 */
public abstract class TemplateElement {
	/**
	 * Whether or not to handle spacing.
	 */
	public boolean spacing;

	/**
	 * The template this element belongs to.
	 */
	public GrammarTemplate belongsTo;

	/**
	 * Create a new template element.
	 * 
	 * @param spacing
	 *                Whether or not to handle spacing.
	 */
	protected TemplateElement(boolean spacing) {
		this.spacing = spacing;
	}

	/**
	 * Generate this template element.
	 * 
	 * @param state
	 *              The state for the generation.
	 */
	public abstract void generate(GenerationState state);
}