Noeud « Previous »: Predefined Types, Noeud « Up »: Predefined Entities



2.2 Predefined Functions

Some runtime function may fail if some assertions are not fulfilled. In that case, the program must exit with a properly labelled error message, and with exit code 120. Please, note that the error messages are standardized, and must be exactly observed. Any difference, in better or worse, is a failure to comply with the (this) Tiger Reference Manual.

— string: chr (code : int)

Return the one character long string containing the character which code is code. If code does not belong to the range [0..255], raise a runtime error: chr: character out of range.

— string: concat (first: string, second: string)
— void: exit (status: int)

Exit the program with exit code status.

— void: flush ()
— string: getchar ()
— int: not (boolean: int)
— int: ord (string: string)
— void: print (string: string)
— void: print_int (int: int)

Note: this is an EPITA extension. Output int in its decimal canonical form (equivalent to %d for printf).

— int: size (string: string)
— string: substring (string: string, first: int, length: int)

Return a string composed of the characters of string starting at the first character (0 being the origin), and composed of length characters (i.e., up to and including the character first + length).

Let size be the size of the string, the following assertions must hold:

otherwise a runtime failure is raised: substring: arguments out of bounds.