quinta-feira, 19 de dezembro de 2013

18.05.15 Errors

Eu não traduzi este tópico, acesse o site original:
http://seed7.sourceforge.net/manual/index.htm
Depois vá para a seção: 15. ERRORS

Detalhes da seção:

18.05.14 Foreign Function Interface

Eu não traduzi este tópico, acesse o site original:
http://seed7.sourceforge.net/manual/index.htm
Depois vá para a seção: 14. FOREIGN FUNCTION INTERFACE

Detalhes da seção:

quarta-feira, 18 de dezembro de 2013

18.05.13 Primitive Actions


Eu não traduzi este tópico, acesse o site original:
http://seed7.sourceforge.net/manual/index.htm
Depois vá para a seção: 7. PRIMITIVE ACTIONS

Detalhes da seção:
http://seed7.sourceforge.net/manual/actions.htm

18.05.12 Operating System Access

Eu não traduzi este tópico, acesse o site original:
http://seed7.sourceforge.net/manual/index.htm
Depois vá para a seção: 7. OPERATING SYSTEM ACCESS

Detalhes da seção:
http://seed7.sourceforge.net/manual/os.htm


18.05.11 Expressions

Eu não traduzi este tópico, acesse o site original:
http://seed7.sourceforge.net/manual/index.htm
Depois vá para a seção: 7. EXPRESSIONS

Detalhes da seção:
http://seed7.sourceforge.net/manual/expr.htm

18.05.10 Tokens

Eu não traduzi este tópico, acesse o site original:
http://seed7.sourceforge.net/manual/index.htm
Depois vá para a seção: 7. TOKENS

Detalhes da seção:
http://seed7.sourceforge.net/manual/tokens.htm

18.05.09 Structured Syntax Definition

Eu não traduzi este tópico, acesse o site original:
http://seed7.sourceforge.net/manual/index.htm
Depois vá para a seção: 7. STRUCTURED SYNTAX DEFINITION

Detalhes da seção:
http://seed7.sourceforge.net/manual/syntax.htm

18.05.08 The File System

Eu não traduzi este tópico, acesse o site original:
http://seed7.sourceforge.net/manual/index.htm
Depois vá para a seção: 7. THE FILE SYSTEM

Detalhes da seção:
http://seed7.sourceforge.net/manual/file.htm

18.05.07 Object Orientation

Eu não traduzi este tópico, acesse o site original:
http://seed7.sourceforge.net/manual/index.htm
Depois vá para a seção: 7. OBJECT ORIENTATION

Detalhes da seção:
http://seed7.sourceforge.net/manual/objects.htm#OBJECT_ORIENTATION

18.05.06 Parameters

Eu não traduzi este tópico, acesse o site original:
http://seed7.sourceforge.net/manual/index.htm
Depois vá para a seção: 5. PARAMETERS

Detalhes da seção:
http://seed7.sourceforge.net/manual/params.htm

18.05.05 Predefined Types

Eu não traduzi este tópico, acesse o site original:
http://seed7.sourceforge.net/manual/index.htm
Depois vá para a seção: 5. PREDEFINED TYPES

Detalhes da seção:
http://seed7.sourceforge.net/manual/types.htm

18.05.04.08 Instrução case

 

Exemplo

 

 

case currChar of

  when {'A' .. 'Z'} | {'a' .. 'z'}:

    characterClass := LETTER;

  when {'0' .. '9'}:

    characterClass := DIGIT;

  when {'!', '$', '%', '&', '*', '+', ',', '-', '.', '/',

      ':', ';', '<', '=', '>', '?', '@', '\', '^', '`',

      '|', '~'}:

    characterClass := SPECIAL;

  when {'(', ')', '[', ']', '{', '}'}:

    characterClass := PAREN;

  when {'"'}:  # Also possible '\"'

    characterClass := APPOSTROPHE;

  when {'''}:  # Also possible '\''

    characterClass := QUOTE;

  otherwise:

    characterClass := ILLEGAL;

end case;

 

 

 

Semântica:

 

A expressão entre "case" e "of" é analisada.

Quando o resultado "casa" com algum elemento entre as várias instruções "when" as instruções logo após os : (dois-pontos) são executadas e a instrução "case" é finalizada.

Quando o valor não "casar" com nenhum elemento entre as várias instruções "when", então as instruções logo após os : (dois-pontos) do bloco "otherwise" são executadas e a instrução "case" é finalizada.

Quando o valor não "casar" com nenhum elemento entre as várias instruções "when" e não houver a instrução "otherwise" a instrução "case" é finalizada.

 

Sintaxe:

 

 

case_statement ::=

'case' expression 'of'

  { 'when' set_expression ':'

    statement }

  [ 'otherwise' ':'

    statement ]

'end' 'case' .

 

set_expression ::=

expression .

 

 

 

Declaration:

 

 

$ syntax expr: .case.().of.().end.case is                      -> 25;

$ syntax expr: .case.().of.().otherwise. : .().end.case is     -> 25;

$ syntax expr: .case.().of.end.case is                         -> 25;

 

$ syntax expr: .when.(). : .().() is              <- 60;

$ syntax expr: .when.(). : .() is                 <- 60;

 

const proc: CASE_DECLS (in type: aType) is func

  local

    var type: WHEN_RESULT is void;

    var type: WHEN_PROC is void;

    var type: SELECTOR_TYPE is void;

  begin

    WHEN_RESULT := newtype;

    WHEN_PROC := (func WHEN_RESULT);

    SELECTOR_TYPE := set of aType;

    const proc: case (ref aType param) of end case                       is noop;

    const proc: case (ref aType param) of

                  (ref WHEN_PROC param)

                end case                                                 is action "PRC_CASE";

    const proc: case (ref aType param) of

                  (ref WHEN_PROC param)

                  otherwise : (ref proc param)

                end case                                                 is action "PRC_CASE_DEF";

    const proc: (ref WHEN_RESULT param) ::= enumlit                      is action "ENU_GENLIT";

    const WHEN_RESULT: WHEN_EMPTY (attr aType) is enumlit;

    const proc: (ref WHEN_PROC param) ::= (ref WHEN_RESULT param)        is action "ENU_CREATE";

    const WHEN_PROC: when (ref SELECTOR_TYPE param) : (ref proc param)   is WHEN_EMPTY(aType);

    const WHEN_PROC: when (ref SELECTOR_TYPE param) : (ref proc param)

                       (ref WHEN_PROC param)                             is WHEN_EMPTY(aType);

  end func;

 

CASE_DECLS(integer);

CASE_DECLS(char);

 

 

 

 

 

 

 

18.05.04.07 Instrução if

 

Exemplo

 

 

if sumValue < minimum then

  factor := sumValue;

  sumValue := minimum;

elsif sumValue > maximum then

  factor := -sumValue;

  sumValue := maximum;

else

  factor := 0;

end if;

 

 

 

Semântica:

 

A expressão entre "if" e "then" é processada.

Quando tal expressão resulta em TRUE as instruções seguintes a "then" são executadas e a instrução "if" é finalizada.

Se a expressão de "if" e todas expressões "elsif" resultarem em FALSE as instruções do bloco "else" serão executadas e a instrução "if" é finalizada.

Se a expressão de "if" e todas expressões "elsif" resultarem em FALSE e não existir um "else" a instrução "if" é finalizada.

 

Sintaxe:

 

 

if_statement ::=

'if' expression 'then'

  statement

{ 'elsif' expression 'then'

  statement }

[ 'else'

  statement ]

'end' 'if' .

 

 

 

A expressão deve ser do tipo "boolean".

 

Declaration:

 

 

$ syntax expr: .if.().then.().end.if is           -> 25;

$ syntax expr: .if.().then.().().end.if is        -> 25;

 

$ syntax expr: .elsif.().then.() is               <- 60;

$ syntax expr: .elsif.().then.().() is            <- 60;

$ syntax expr: .else.() is                        <- 60;

 

const type: ELSIF_RESULT is newtype;

const proc: (ref ELSIF_RESULT param) ::= enumlit is  action "ENU_GENLIT";

const ELSIF_RESULT: ELSIF_EMPTY is enumlit;

const type: ELSIF_PROC is                        (func ELSIF_RESULT);

const proc: (ref ELSIF_PROC param) ::= (ref ELSIF_RESULT param) is action "ENU_CREATE";

 

const proc:       if (in boolean param) then

                    (in proc param)

                  end if is                        action "PRC_IF";

 

const proc:       if (in boolean param) then

                    (in proc param)

                  (in ELSIF_PROC param)

                  end if is                        action "PRC_IF_ELSIF";

 

const ELSIF_PROC: elsif (in boolean param) then

                    (in proc param) is             action "PRC_IF";

 

const ELSIF_PROC: elsif (in boolean param) then

                    (in proc param)

                  (in ELSIF_PROC param) is         action "PRC_IF_ELSIF";

 

const ELSIF_PROC: else

                    (in void param) is             ELSIF_EMPTY;

 

 

const proc: if TRUE  then (in void param) end if is                           noop;

const proc: if TRUE  then (in void param) (in ELSIF_PROC param) end if is     noop;

const proc: if FALSE then (in proc param) end if is                           noop;

const proc: if FALSE then (in proc param) (in ELSIF_RESULT param) end if is   noop;

const ELSIF_PROC: elsif TRUE  then (in void param) is                         ELSIF_EMPTY;

const ELSIF_PROC: elsif TRUE then (in void param) (in ELSIF_PROC param)   is  ELSIF_EMPTY;

const ELSIF_PROC: elsif FALSE then (in proc param) is                         ELSIF_EMPTY;

const ELSIF_PROC: elsif FALSE then (in proc param) (in ELSIF_RESULT param) is ELSIF_EMPTY;