OpenCores
URL https://opencores.org/ocsvn/raptor64/raptor64/trunk

Subversion Repositories raptor64

[/] [raptor64/] [trunk/] [software/] [c64/] [source/] [Intexpr.c] - Blame information for rev 51

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 37 robfinch
#include <stdio.h>
2
#include "c.h"
3
#include "expr.h"
4
#include "gen.h"
5
#include "cglbdec.h"
6
 
7
/*
8
 *      68000 C compiler
9
 *
10
 *      Copyright 1984, 1985, 1986 Matthew Brandt.
11
 *  all commercial rights reserved.
12
 *
13
 *      This compiler is intended as an instructive tool for personal use. Any
14
 *      use for profit without the written consent of the author is prohibited.
15
 *
16
 *      This compiler may be distributed freely for non-commercial use as long
17
 *      as this notice stays intact. Please forward any enhancements or questions
18
 *      to:
19
 *
20
 *              Matthew Brandt
21
 *              Box 920337
22
 *              Norcross, Ga 30092
23
 */
24
 
25
/*******************************************************
26
        Modified to support Raptor64 'C64' language
27
        by Robert Finch
28
        robfinch@opencores.org
29
*******************************************************/
30
 
31 51 robfinch
__int64 GetIntegerExpression()       /* simple integer value */
32 37 robfinch
{
33 51 robfinch
        __int64 temp;
34 37 robfinch
    SYM *sp;
35
 
36
        if(lastst == id) {
37
        sp = gsearch(lastid);
38
        if(sp == NULL) {
39
            error(ERR_UNDEFINED);
40
            NextToken();
41
            return 0;
42
        }
43
        if(sp->storage_class != sc_const) {
44
            error(ERR_SYNTAX);
45
            NextToken();
46
            return 0;
47
        }
48
        NextToken();
49
        return sp->value.i;
50
    }
51
    else if(lastst == iconst)
52
        {
53
                temp = ival;
54
                NextToken();
55
                return temp;
56
    }
57
    NextToken();
58
    error(ERR_SYNTAX);
59
    return 0;
60
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.