pj
Class PJ.MacInfo

java.lang.Object
  extended by pj.PJ.Info
      extended by pj.PJ.MacInfo
All Implemented Interfaces:
Dump.Helper, Leaf
Enclosing class:
PJ

protected class PJ.MacInfo
extends PJ.Info

represents a JLex macro. PJ.Info.type would be set by PJ.IdInfo.


Field Summary
protected  String lex
          regular expression for JLex.
protected  boolean screened
          true if used in %screen or %skip.
protected  boolean skipped
          true if used in %screen or %skip.
protected  PJ.IdInfo token
          token represented by this macro, if any.
 
Fields inherited from class pj.PJ.Info
id, represented, type
 
Constructor Summary
protected PJ.MacInfo(String id)
           
protected PJ.MacInfo(String id, String lex)
           
 
Method Summary
 boolean collect()
          true if this leaf is to be collected.
 String comment()
          descriptive comment.
 void define(PrintWriter out)
          create JLex macro definition.
 void dump(Dump sender, Class c, Object o)
           
 void lex(PrintWriter out)
          create JLex rule.
 void screen(PrintWriter out)
          create JLex screen rule.
 void setLex(String lex)
           
 void setScreened()
           
 void setSkipped()
           
 void setToken(PJ.IdInfo token)
           
 void setup()
          check that macro is defined.
 void skip(PrintWriter out)
          create JLex skip rule.
 
Methods inherited from class pj.PJ.Info
name, setName, setType, type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lex

protected String lex
regular expression for JLex. The macro is undefined if this is null.


screened

protected boolean screened
true if used in %screen or %skip.

See Also:
setScreened(), setSkipped(), setToken(pj.PJ.IdInfo)

skipped

protected boolean skipped
true if used in %screen or %skip.

See Also:
setScreened(), setSkipped(), setToken(pj.PJ.IdInfo)

token

protected PJ.IdInfo token
token represented by this macro, if any.

See Also:
setSkipped(), setToken(pj.PJ.IdInfo)
Constructor Detail

PJ.MacInfo

protected PJ.MacInfo(String id)

PJ.MacInfo

protected PJ.MacInfo(String id,
                     String lex)
Method Detail

setLex

public void setLex(String lex)

setup

public void setup()
check that macro is defined.


setScreened

public void setScreened()

setSkipped

public void setSkipped()

setToken

public void setToken(PJ.IdInfo token)

define

public void define(PrintWriter out)
create JLex macro definition.


skip

public void skip(PrintWriter out)
create JLex skip rule.


screen

public void screen(PrintWriter out)
create JLex screen rule.


lex

public void lex(PrintWriter out)
create JLex rule. Called from PJ.Token.lex(boolean, java.io.PrintWriter), i.e. token is not null.

Specified by:
lex in interface Leaf
Overrides:
lex in class PJ.Info

comment

public String comment()
Description copied from class: PJ.Info
descriptive comment.

Overrides:
comment in class PJ.Info

collect

public boolean collect()
Description copied from interface: Leaf
true if this leaf is to be collected.

Specified by:
collect in interface Leaf
Overrides:
collect in class PJ.Info

dump

public void dump(Dump sender,
                 Class c,
                 Object o)