This repository was archived by the owner on Dec 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeder.7
More file actions
117 lines (108 loc) · 2.65 KB
/
feder.7
File metadata and controls
117 lines (108 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
.\" Manpage for feder
.\" Copyright (C) 2018 Fionn Langhans
.\" (fionn.langhans@gmail.com)
.\"
.TH FEDER 7 2018-02-15 "Feder" "Feder Manual"
.SH NAME
feder \- A short introduction to Feder
.SH SYNOPSIS
.SY jfederc
.OP \-D builddir
.OP \-O program_name
.I files
.YS
.SY federc
.OP operation
.OP arguments
.YS
.SH DESCRIPTION
This page describes, how to write little programs with the Feder programming
language and how to compile them. Currently Feder can only be compiled with
the jfederc (Java Feder Compiler, a Feder compiler written in Java).
.SS Basics
In Feder bodies can be started with
.IR class ", " namespace ", " type ", " func ", " if ", " else " and " while "."
.RI "Bodies must be terminated with"
.BR ';' ". All bodies have to be closed at the end of the source file."
.RB "Bodies can contain other bodies, but some bodies mustn't contain specific"
.RB "bodies."
.RB "To comment the code use the " # " operator to make the compiler ignore the"
.RB "source code from that point till"
.RB "the end of the line. If you want to comment over several lines use the " ##
.RB "operator. If you want to terminate the multi-line comment use the " ##
.RB "operator again."
.B Examples
.EX
.BR # " comment"
.IR code " # comment"
.BR "## " I
am a very,
very long
comment reaching
over several
.RB lines " ##"
.EE
.\" End of Basics
.SS Objects
Feder handles object in three different way: as an object created with a class,
as an object created with an interface, as an object created with a type or as
object object created with an array.
Only the object created with a class can be a dynamic one, all others are
static. The specifier of an object created with a class or a type can be
guessed, but the specifier of an interface can't really be guessed, so you have
to explicitly declare an object, which should be created with an interface, with
an interface.
The '[]' show that the object could be declared as an array with the given type.
.TP 10
.B Create object with a class
[
.I class
] [
.BI '[]'
]
.I name
[
.BI '='
.I objectWithClass
]
.\" End object with class definition
Examples:
.EX
String s = String
s0 = String
s1 = s0.cp ()
.EE
.TP
.B Create object with a type
[
.I type
] [
.BI '[]'
]
.I name
[
.BI '='
.I objectWithArray
]
.\" End object with type definition
.TP
.B Create object with an interface
.I interface name
[
.BI '='
.I objectWithInterface
|
.I function
]
.\" End object with interface definition
.SS Classes
Classes in Feder are structures that can contain objects and functions. They
also can inherit class and objects from another class.
Create a class:
.BI 'class'
.I name
[
.I ClassToInheritFrom
]
A class starts a new body, so if you want to close the body use
.BI ';'