com.vaadin.sass.internal
Class Scope

java.lang.Object
  extended by com.vaadin.sass.internal.Scope

public class Scope
extends Object

Nestable scope for variables, functions and mixins.


Constructor Summary
Scope()
           
Scope(Scope parent)
           
 
Method Summary
 void addVariable(Variable node)
          Sets a variable in the current scope without checking parent scopes.
 void defineFunction(FunctionDefNode function)
           
 void defineMixin(MixinDefNode mixin)
           
 FunctionDefNode getFunctionDefinition(String name)
           
 MixinDefNode getMixinDefinition(String name)
           
 Scope getParent()
           
 Variable getVariable(String name)
           
 Iterable<Variable> getVariables()
          Returns an Iterable of all variables defined in this scope and its parents.
 void setVariable(Variable node)
          Sets a variable value in the largest scope where it is already defined.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Scope

public Scope()

Scope

public Scope(Scope parent)
Method Detail

getParent

public Scope getParent()

setVariable

public void setVariable(Variable node)
Sets a variable value in the largest scope where it is already defined. If the variable isn't defined, set it in the current scope.

Parameters:
node - variable to set

addVariable

public void addVariable(Variable node)
Sets a variable in the current scope without checking parent scopes.

Parameters:
node - variable to set

getVariable

public Variable getVariable(String name)

getVariables

public Iterable<Variable> getVariables()
Returns an Iterable of all variables defined in this scope and its parents. Variables that are masked by a similarly named copy in an inner scope are not returned, but only the innermost instance is used.

Returns:
iterable over all variables in scope, generated iterators are unmodifiable

defineFunction

public void defineFunction(FunctionDefNode function)

defineMixin

public void defineMixin(MixinDefNode mixin)

getFunctionDefinition

public FunctionDefNode getFunctionDefinition(String name)

getMixinDefinition

public MixinDefNode getMixinDefinition(String name)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013–2015 Vaadin. All rights reserved.