Class UseComments

java.lang.Object
javax0.jamal.extensions.UseComments
All Implemented Interfaces:
javax0.jamal.api.Identified, javax0.jamal.api.Macro, javax0.jamal.api.ServiceLoaded

public class UseComments extends Object implements javax0.jamal.api.Macro
This macro removes all the lines that start with // from the input.

This demonstrates how a macro can implement fetch(Processor, Input) that alters the input before the macro is evaluated.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface javax0.jamal.api.Identified

    javax0.jamal.api.Identified.Undefined

    Nested classes/interfaces inherited from interface javax0.jamal.api.Macro

    javax0.jamal.api.Macro.Stateful
  • Field Summary

    Fields inherited from interface javax0.jamal.api.Identified

    DEFAULT_MACRO, MACRO_NAME_ARG1, MACRO_NAME_ARG2

    Fields inherited from interface javax0.jamal.api.Macro

    FETCH
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    evaluate(javax0.jamal.api.Input in, javax0.jamal.api.Processor processor)
     
    fetch(javax0.jamal.api.Processor processor, javax0.jamal.api.Input input)
     
     
    prefetch(javax0.jamal.api.Processor processor, javax0.jamal.api.Input input)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface javax0.jamal.api.Macro

    getIds
  • Constructor Details

    • UseComments

      public UseComments()
  • Method Details

    • evaluate

      public String evaluate(javax0.jamal.api.Input in, javax0.jamal.api.Processor processor) throws javax0.jamal.api.BadSyntax
      Specified by:
      evaluate in interface javax0.jamal.api.Macro
      Throws:
      javax0.jamal.api.BadSyntax
    • getId

      public String getId()
      Specified by:
      getId in interface javax0.jamal.api.Identified
      Specified by:
      getId in interface javax0.jamal.api.Macro
    • prefetch

      public String prefetch(javax0.jamal.api.Processor processor, javax0.jamal.api.Input input) throws javax0.jamal.api.BadSyntaxAt
      Specified by:
      prefetch in interface javax0.jamal.api.Macro
      Throws:
      javax0.jamal.api.BadSyntaxAt
    • fetch

      public String fetch(javax0.jamal.api.Processor processor, javax0.jamal.api.Input input) throws javax0.jamal.api.BadSyntaxAt
      Specified by:
      fetch in interface javax0.jamal.api.Macro
      Throws:
      javax0.jamal.api.BadSyntaxAt