Package gnu.expr

Class ExpVisitor<R,​D>

    • Field Detail

      • currentLambda

        protected LambdaExp currentLambda
      • exitValue

        protected Object exitValue
        If exitValue is set to non-null, the visit stops.
    • Constructor Detail

      • ExpVisitor

        public ExpVisitor()
    • Method Detail

      • getCompilation

        public Compilation getCompilation()
        Get the Compilation associated with this visitor.
      • getLanguage

        public Language getLanguage()
      • defaultValue

        protected R defaultValue​(Expression r,
                                 D d)
      • visitExpression

        protected R visitExpression​(Expression exp,
                                    D d)
      • setContext

        public void setContext​(Compilation comp)
      • visit

        public R visit​(Expression exp,
                       D d)
        Call the visit method of argument Expression. Could call Expression's visit directly, but this allows us to interpose a method call on each Expression. We use it to note the Expression's line number. Should not need to be overridden; if you do, you may also want to override visitExps.
      • visitApplyExp

        protected R visitApplyExp​(ApplyExp exp,
                                  D d)
      • visitIfExp

        protected R visitIfExp​(IfExp exp,
                               D d)
      • visitCaseExp

        protected R visitCaseExp​(CaseExp exp,
                                 D d)
      • visitDeclarationType

        protected void visitDeclarationType​(Declaration decl)
      • visitDeclarationTypes

        protected final void visitDeclarationTypes​(ScopeExp exp)
      • visitScopeExp

        protected R visitScopeExp​(ScopeExp exp,
                                  D d)
      • visitLetExp

        protected R visitLetExp​(LetExp exp,
                                D d)
      • visitLambdaExp

        protected R visitLambdaExp​(LambdaExp exp,
                                   D d)
      • visitClassExp

        protected R visitClassExp​(ClassExp exp,
                                  D d)
      • visitObjectExp

        protected R visitObjectExp​(ObjectExp exp,
                                   D d)
      • visitModuleExp

        protected R visitModuleExp​(ModuleExp exp,
                                   D d)
      • visitSetExp

        protected R visitSetExp​(SetExp exp,
                                D d)
      • visitTryExp

        protected R visitTryExp​(TryExp exp,
                                D d)
      • visitBeginExp

        protected R visitBeginExp​(BeginExp exp,
                                  D d)
      • visitQuoteExp

        protected R visitQuoteExp​(QuoteExp exp,
                                  D d)
      • visitReferenceExp

        protected R visitReferenceExp​(ReferenceExp exp,
                                      D d)
      • visitThisExp

        protected R visitThisExp​(ThisExp exp,
                                 D d)
      • visitSynchronizedExp

        protected R visitSynchronizedExp​(SynchronizedExp exp,
                                         D d)
      • visitBlockExp

        protected R visitBlockExp​(BlockExp exp,
                                  D d)
      • visitExitExp

        protected R visitExitExp​(ExitExp exp,
                                 D d)
      • visitFluidLetExp

        protected R visitFluidLetExp​(FluidLetExp exp,
                                     D d)
      • visitLangExp

        protected R visitLangExp​(LangExp exp,
                                 D d)
      • getExitValue

        public Object getExitValue()
      • getCurrentLambda

        public final LambdaExp getCurrentLambda()
      • visitExps

        public Expression[] visitExps​(Expression[] exps,
                                      int n,
                                      D d)
        Call visit on the Expressions in an array. However, the visit method is inlined for speed.
      • visitDefaultArgs

        public void visitDefaultArgs​(LambdaExp exp,
                                     D d)
      • error

        public void error​(char kind,
                          String message)
      • getStartLine

        public final int getStartLine()
        Description copied from interface: SourceLocator
        Line number (one-origin) of start of range; unknown/unspecified is -1.
        Specified by:
        getStartLine in interface SourceLocator
      • getStartColumn

        public final int getStartColumn()
        Description copied from interface: SourceLocator
        Column (one-origin) of start of range; unknown/unspecified is -1.
        Specified by:
        getStartColumn in interface SourceLocator
      • getEndLine

        public final int getEndLine()
        Description copied from interface: SourceLocator
        Line number (one-origin) of end of range; unknown/unspecified is -1.
        Specified by:
        getEndLine in interface SourceLocator
      • getEndColumn

        public final int getEndColumn()
        Description copied from interface: SourceLocator
        Column (one-origin) of end of range; unknown/unspecified is -1.
        Specified by:
        getEndColumn in interface SourceLocator
      • setFile

        public void setFile​(String filename)
      • setLine

        public void setLine​(int line)
      • setColumn

        public void setColumn​(int column)
      • setLine

        public void setLine​(String filename,
                            int line,
                            int column)