6. Comments

Aus Hugo Doku

Wechseln zu: Navigation, Suche

To comment your Frame classes use HuGo comments.

There are two kind of HuGo comments:

1. one-line comment
@@ comment_line
Here the rest of the line is interpreted as comment:
2. comment brackets
/@ comment_over_any_amount_of_lines @/
Here every sign within this comment bracket are interpreted as comment, including new lines.

Example 6.1. Comments in Frame classes

As the following listings shows, you have to distinguish between comments, which comment your Frame class, and comments of the target language, which should be generated.

demo_class.jxgp:

package java_frames;
public class demo_class extends Frame
{
  public @#String name;
  
   @#gen JCLASS<!name+".java","src","JAVA"!>
   <#java
       @@ HuGo comment one line: is not generated
       /@ HuGo comment several lines
       ....@/
       // a comment of the target language, which will be generated
       public class <!name!>
       {
       }
   #>
}

The demo.model

<model>
   <demo_class name="CommentedClass"/>
</model>

The generated CommentedClass.java

       // a comment of the target language, which will be generated
       public class CommentedClass
       {
       }

caution Caution

As the HuGo Syntax is a Java Meta Language, you can use Java comments outside generating methods as well to comment your Frames. But within this comments HuGo keywords are as well interpreted, thus you cannot use this kind of comment to temporarily comment out instructions.
For this reason we recommend: Only use HuGo comments to comment your Frame class!


Next: 7. Attribute Variables
Persönliche Werkzeuge