DU4 - nejde zkompilovat

Úvodní kurz překladačů se soustřeďuje zejména na teoretické i praktické základy konstrukce přední části překladače. Součástí předmětu je i cvičení zaměřující se na základy práce s nástroji pro konstrukci překladačů. Po absolvování tohoto kurzu bude posluchač schopen sestrojit vlastní překladač do mezikódu nebo jiného jazyka.
Šlupka
Matfyz(ák|ačka) level I
Příspěvky: 39
Registrován: 7. 11. 2007 22:12
Typ studia: Informatika Bc.

DU4 - nejde zkompilovat

Příspěvek od Šlupka »

Zdravím,
nesetkal se někdo s následujícím problémem:

Vzal jsem defaultní stažený projekt, otevřel ve Visual Studio 2008, nastavil cesty a kompilace jinak netknutého projektu dopadla takto:

Kód: Vybrat vše

1>------ Rebuild All started: Project: mlcxslt, Configuration: Debug Win32 ------
2>------ Rebuild All started: Project: mlcgrm, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'mlcxslt', configuration 'Debug|Win32'
2>Deleting intermediate and output files for project 'mlcgrm', configuration 'Debug|Win32'
2>Flex
1>Performing Custom Build Step
2>Bison
1>Performing Custom Build Step
1>Performing Custom Build Step
2>Build log was saved at "file://c:\Users\Slupka\Desktop\Projects\Škola\Mag. Prvák\Principy překladačů\du4\public-rw\SWI098\du4\Debug\BuildLog.htm"
2>mlcgrm - 0 error(s), 0 warning(s)
1>Performing Custom Build Step
1>Performing Custom Build Step
1>Performing Custom Build Step
1>Build log was saved at "file://c:\Users\Slupka\Desktop\Projects\Škola\Mag. Prvák\Principy překladačů\du4\public-rw\SWI098\du4\Debug\BuildLog.htm"
1>mlcxslt - 0 error(s), 1 warning(s)
3>------ Rebuild All started: Project: mlc, Configuration: Debug Win32 ------
3>Deleting intermediate and output files for project 'mlc', configuration 'Debug|Win32'
3>Compiling...
3>abstract_ic.cpp
3>du4.cpp
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(79) : warning C4100: 'pReserved' : unreferenced formal parameter
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(130) : warning C4189: 'rv2' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(129) : warning C4189: 'rv1' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(131) : warning C4189: 'rv3' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(136) : warning C4189: 'rv2' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(135) : warning C4189: 'rv1' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(137) : warning C4189: 'rv3' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(142) : warning C4189: 'rv2' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(141) : warning C4189: 'rv1' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(143) : warning C4189: 'rv3' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(148) : warning C4189: 'rv2' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(147) : warning C4189: 'rv1' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(149) : warning C4189: 'rv3' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(154) : warning C4189: 'rv2' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(153) : warning C4189: 'rv1' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(155) : warning C4189: 'rv3' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(160) : warning C4189: 'rv2' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(159) : warning C4189: 'rv1' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(161) : warning C4189: 'rv3' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(166) : warning C4189: 'rv2' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(165) : warning C4189: 'rv1' : local variable is initialized but not referenced
3>..\..\..\public-ro\mlc\du4\src\du4.cpp(167) : warning C4189: 'rv3' : local variable is initialized but not referenced
3>du4baseerrtab.cpp
3>duerr.cpp
3>dusememptyerrtab.cpp
3>dutables.cpp
3>..\..\..\public-ro\mlc\src\dutables.cpp(819) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'const int *' (or there is no acceptable conversion)
3>        C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\list(323): could be 'std::list<_Ty>::_Const_iterator<_Secure_validation> &std::list<_Ty>::_Const_iterator<_Secure_validation>::operator =(const std::list<_Ty>::_Const_iterator<_Secure_validation> &)'
3>        with
3>        [
3>            _Ty=int,
3>            _Secure_validation=true
3>        ]
3>        while trying to match the argument list '(std::list<_Ty>::_Const_iterator<_Secure_validation>, const int *)'
3>        with
3>        [
3>            _Ty=int,
3>            _Secure_validation=true
3>        ]
3>..\..\..\public-ro\mlc\src\dutables.cpp(1681) : error C2664: 'mlc::symbol_tables::add_type' : cannot convert parameter 2 from 'const std::basic_string<_Elem,_Traits,_Ax> *' to 'mlc::ls_id_index'
3>        with
3>        [
3>            _Elem=char,
3>            _Traits=std::char_traits<char>,
3>            _Ax=std::allocator<char>
3>        ]
3>        No constructor could take the source type, or constructor overload resolution was ambiguous
3>..\..\..\public-ro\mlc\src\dutables.cpp(1685) : error C2664: 'mlc::symbol_tables::add_type' : cannot convert parameter 2 from 'const std::basic_string<_Elem,_Traits,_Ax> *' to 'mlc::ls_id_index'
3>        with
3>        [
3>            _Elem=char,
3>            _Traits=std::char_traits<char>,
3>            _Ax=std::allocator<char>
3>        ]
3>        No constructor could take the source type, or constructor overload resolution was ambiguous
3>..\..\..\public-ro\mlc\src\dutables.cpp(1689) : error C2664: 'mlc::symbol_tables::add_type' : cannot convert parameter 2 from 'const std::basic_string<_Elem,_Traits,_Ax> *' to 'mlc::ls_id_index'
3>        with
3>        [
3>            _Elem=char,
3>            _Traits=std::char_traits<char>,
3>            _Ax=std::allocator<char>
3>        ]
3>        No constructor could take the source type, or constructor overload resolution was ambiguous
3>..\..\..\public-ro\mlc\src\dutables.cpp(1693) : error C2664: 'mlc::symbol_tables::add_type' : cannot convert parameter 2 from 'const std::basic_string<_Elem,_Traits,_Ax> *' to 'mlc::ls_id_index'
3>        with
3>        [
3>            _Elem=char,
3>            _Traits=std::char_traits<char>,
3>            _Ax=std::allocator<char>
3>        ]
3>        No constructor could take the source type, or constructor overload resolution was ambiguous
3>..\..\..\public-ro\mlc\src\dutables.cpp(1696) : error C2664: 'mlc::symbol_tables::add_const_bool' : cannot convert parameter 2 from 'const std::basic_string<_Elem,_Traits,_Ax> *' to 'mlc::ls_id_index'
3>        with
3>        [
3>            _Elem=char,
3>            _Traits=std::char_traits<char>,
3>            _Ax=std::allocator<char>
3>        ]
3>        No constructor could take the source type, or constructor overload resolution was ambiguous
3>..\..\..\public-ro\mlc\src\dutables.cpp(1699) : error C2664: 'mlc::symbol_tables::add_const_bool' : cannot convert parameter 2 from 'const std::basic_string<_Elem,_Traits,_Ax> *' to 'mlc::ls_id_index'
3>        with
3>        [
3>            _Elem=char,
3>            _Traits=std::char_traits<char>,
3>            _Ax=std::allocator<char>
3>        ]
3>        No constructor could take the source type, or constructor overload resolution was ambiguous
3>..\..\..\public-ro\mlc\src\dutables.cpp(1704) : error C2440: 'initializing' : cannot convert from 'const std::basic_string<_Elem,_Traits,_Ax> *' to 'std::list<_Ty>::_Const_iterator<_Secure_validation>'
3>        with
3>        [
3>            _Elem=char,
3>            _Traits=std::char_traits<char>,
3>            _Ax=std::allocator<char>
3>        ]
3>        and
3>        [
3>            _Ty=std::string,
3>            _Secure_validation=true
3>        ]
3>        No constructor could take the source type, or constructor overload resolution was ambiguous
3>..\..\..\public-ro\mlc\src\dutables.cpp(1714) : error C2440: 'initializing' : cannot convert from 'const std::basic_string<_Elem,_Traits,_Ax> *' to 'std::list<_Ty>::_Const_iterator<_Secure_validation>'
3>        with
3>        [
3>            _Elem=char,
3>            _Traits=std::char_traits<char>,
3>            _Ax=std::allocator<char>
3>        ]
3>        and
3>        [
3>            _Ty=std::string,
3>            _Secure_validation=true
3>        ]
3>        No constructor could take the source type, or constructor overload resolution was ambiguous
3>..\..\..\public-ro\mlc\src\dutables.cpp(1724) : error C2440: 'initializing' : cannot convert from 'const std::basic_string<_Elem,_Traits,_Ax> *' to 'std::list<_Ty>::_Const_iterator<_Secure_validation>'
3>        with
3>        [
3>            _Elem=char,
3>            _Traits=std::char_traits<char>,
3>            _Ax=std::allocator<char>
3>        ]
3>        and
3>        [
3>            _Ty=std::string,
3>            _Secure_validation=true
3>        ]
3>        No constructor could take the source type, or constructor overload resolution was ambiguous
3>..\..\..\public-ro\mlc\src\dutables.cpp(1732) : error C2440: 'initializing' : cannot convert from 'const std::basic_string<_Elem,_Traits,_Ax> *' to 'std::list<_Ty>::_Const_iterator<_Secure_validation>'
3>        with
3>        [
3>            _Elem=char,
3>            _Traits=std::char_traits<char>,
3>            _Ax=std::allocator<char>
3>        ]
3>        and
3>        [
3>            _Ty=std::string,
3>            _Secure_validation=true
3>        ]
3>        No constructor could take the source type, or constructor overload resolution was ambiguous
3>..\..\..\public-ro\mlc\src\dutables.cpp(1738) : error C2440: 'initializing' : cannot convert from 'const std::basic_string<_Elem,_Traits,_Ax> *' to 'std::list<_Ty>::_Const_iterator<_Secure_validation>'
3>        with
3>        [
3>            _Elem=char,
3>            _Traits=std::char_traits<char>,
3>            _Ax=std::allocator<char>
3>        ]
3>        and
3>        [
3>            _Ty=std::string,
3>            _Secure_validation=true
3>        ]
3>        No constructor could take the source type, or constructor overload resolution was ambiguous
3>..\..\..\public-ro\mlc\src\dutables.cpp(1749) : error C2440: 'initializing' : cannot convert from 'const std::basic_string<_Elem,_Traits,_Ax> *' to 'std::list<_Ty>::_Const_iterator<_Secure_validation>'
3>        with
3>        [
3>            _Elem=char,
3>            _Traits=std::char_traits<char>,
3>            _Ax=std::allocator<char>
3>        ]
3>        and
3>        [
3>            _Ty=std::string,
3>            _Secure_validation=true
3>        ]
3>        No constructor could take the source type, or constructor overload resolution was ambiguous
3>..\..\..\public-ro\mlc\src\dutables.cpp(1760) : error C2440: 'initializing' : cannot convert from 'const std::basic_string<_Elem,_Traits,_Ax> *' to 'std::list<_Ty>::_Const_iterator<_Secure_validation>'
3>        with
3>        [
3>            _Elem=char,
3>            _Traits=std::char_traits<char>,
3>            _Ax=std::allocator<char>
3>        ]
3>        and
3>        [
3>            _Ty=std::string,
3>            _Secure_validation=true
3>        ]
3>        No constructor could take the source type, or constructor overload resolution was ambiguous
3>..\..\..\public-ro\mlc\src\dutables.cpp(1770) : error C2440: 'initializing' : cannot convert from 'const std::basic_string<_Elem,_Traits,_Ax> *' to 'std::list<_Ty>::_Const_iterator<_Secure_validation>'
3>        with
3>        [
3>            _Elem=char,
3>            _Traits=std::char_traits<char>,
3>            _Ax=std::allocator<char>
3>        ]
3>        and
3>        [
3>            _Ty=std::string,
3>            _Secure_validation=true
3>        ]
3>        No constructor could take the source type, or constructor overload resolution was ambiguous
3>flat_icblock.cpp
3>ic_instr.cpp
3>labeled_icblock.cpp
3>uid_gen.cpp
3>du4g.cpp
3>.\du4g.cpp(1105) : warning C4065: switch statement contains 'default' but no 'case' labels
3>.\du4g.cpp(1257) : warning C4244: '=' : conversion from 'int' to 'yytype_int16', possible loss of data
3>.\du4g.cpp(1424) : warning C4127: conditional expression is constant
3>.\du4g.cpp(1433) : warning C4065: switch statement contains 'default' but no 'case' labels
3>.\du4g.cpp(1537) : warning C4127: conditional expression is constant
3>.\du4g.cpp(1587) : warning C4127: conditional expression is constant
3>.\du4g.cpp(1587) : warning C4127: conditional expression is constant
3>gen_aifactory.cpp
3>gen_icfactory.cpp
3>gen_icinstrtab.cpp
3>du4sem.cpp
3>Generating Code...
3>c:\users\slupka\desktop\projects\škola\mag. prvák\principy překladačů\du4\public-rw\swi098\du4\du4g.cpp(1314) : warning C4702: unreachable code
3>c:\users\slupka\desktop\projects\škola\mag. prvák\principy překladačů\du4\public-rw\swi098\du4\du4g.cpp(1540) : warning C4702: unreachable code
3>Build log was saved at "file://c:\Users\Slupka\Desktop\Projects\Škola\Mag. Prvák\Principy překladačů\du4\public-rw\SWI098\du4\Debug\BuildLog.htm"
3>mlc - 15 error(s), 31 warning(s)
========== Rebuild All: 2 succeeded, 1 failed, 0 skipped ==========
A přitom s dutables.cpp už nic dělat nebudu, takže ta by asi měla být správně od začátku, řekl bych... Na cvičení jsem kvůli promoci nebyl, tak nevím jestli k tomuhle něco neříkali...
Schiroo
Matfyz(ák|ačka) level I
Příspěvky: 28
Registrován: 1. 2. 2006 13:54
Typ studia: Informatika Bc.
Bydliště: Praha

Re: DU4 - nejde zkompilovat

Příspěvek od Schiroo »

Na cvičení k tomu podle mě nic nebylo - řekl bych, že jsem narazil na totéž, ale s použitím gcc. Část toho se možná dá odstranit:

Kód: Vybrat vše

3>..\..\..\public-ro\mlc\du4\src\du4.cpp(79) : warning C4100: 'pReserved' : unreferenced formal parameter
u mně vzniklo, protože neznal typ uint_ptr. Podle manuálové stránky by měla v C být ve stdlib.h, includoval jsem tedy cstdlib a přestal řvát. Ale jestli je tohle to pravé řešení, netuším.

Výpis:

Kód: Vybrat vše

In file included from public-ro/common/h/labeled_icblock.hpp:21,
                 from public-ro/mlc/h/dutables.h:17,
                 from public-ro/mlc/src/dutables.cpp:11:
public-ro/common/h/abstract_instr.hpp:25: warning: extra ‘;’
In file included from public-ro/mlc/src/dutables.cpp:11:
public-ro/mlc/h/dutables.h:1192: warning: extra ‘;’
public-ro/mlc/src/dutables.cpp:351: warning: extra ‘;’
public-ro/mlc/src/dutables.cpp:730: warning: extra ‘;’
public-ro/mlc/src/dutables.cpp: In constructor ‘mlc::symbol_tables::symbol_tables(bool, mlaskal::abstract_ic*)’:
public-ro/mlc/src/dutables.cpp:819: error: no match for ‘operator=’ in ‘((mlc::symbol_tables*)this)->mlc::symbol_tables::one_ = ((mlaskal::aic_literal_storage_int_type*)((mlc::symbol_tables*)this)->mlc::symbol_tables::aic_->mlaskal::abstract_ic::get_ls_int())->mlaskal::lit_storage<T>::add [with T = int](((const int&)((const int*)(&1))))’
/usr/include/c++/4.4/bits/stl_list.h:189: note: candidates are: std::_List_const_iterator<int>& std::_List_const_iterator<int>::operator=(const std::_List_const_iterator<int>&)
public-ro/mlc/src/dutables.cpp: In member function ‘void mlc::symbol_tables::init_builtins()’:
public-ro/mlc/src/dutables.cpp:1681: error: no matching function for call to ‘mlc::symbol_tables::add_type(int, const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, mlc::type_pointer&)’
public-ro/mlc/src/dutables.cpp:1217: note: candidates are: mlc::type_symbol_reference mlc::symbol_tables::add_type(int, mlc::ls_id_index, mlc::type_pointer)
public-ro/mlc/src/dutables.cpp:1685: error: no matching function for call to ‘mlc::symbol_tables::add_type(int, const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, mlc::type_pointer&)’
public-ro/mlc/src/dutables.cpp:1217: note: candidates are: mlc::type_symbol_reference mlc::symbol_tables::add_type(int, mlc::ls_id_index, mlc::type_pointer)
public-ro/mlc/src/dutables.cpp:1689: error: no matching function for call to ‘mlc::symbol_tables::add_type(int, const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, mlc::type_pointer&)’
public-ro/mlc/src/dutables.cpp:1217: note: candidates are: mlc::type_symbol_reference mlc::symbol_tables::add_type(int, mlc::ls_id_index, mlc::type_pointer)
public-ro/mlc/src/dutables.cpp:1693: error: no matching function for call to ‘mlc::symbol_tables::add_type(int, const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, mlc::type_pointer&)’
public-ro/mlc/src/dutables.cpp:1217: note: candidates are: mlc::type_symbol_reference mlc::symbol_tables::add_type(int, mlc::ls_id_index, mlc::type_pointer)
public-ro/mlc/src/dutables.cpp:1696: error: no matching function for call to ‘mlc::symbol_tables::add_const_bool(int, const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool)’
public-ro/mlc/src/dutables.cpp:1125: note: candidates are: mlc::bool_const_symbol_pointer mlc::symbol_tables::add_const_bool(int, mlc::ls_id_index, bool)
public-ro/mlc/src/dutables.cpp:1699: error: no matching function for call to ‘mlc::symbol_tables::add_const_bool(int, const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool)’
public-ro/mlc/src/dutables.cpp:1125: note: candidates are: mlc::bool_const_symbol_pointer mlc::symbol_tables::add_const_bool(int, mlc::ls_id_index, bool)
public-ro/mlc/src/dutables.cpp:1704: error: conversion from ‘const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*’ to non-scalar type ‘mlc::ls_id_index’ requested
public-ro/mlc/src/dutables.cpp:1714: error: conversion from ‘const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*’ to non-scalar type ‘mlc::ls_id_index’ requested
public-ro/mlc/src/dutables.cpp:1724: error: conversion from ‘const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*’ to non-scalar type ‘mlc::ls_id_index’ requested
public-ro/mlc/src/dutables.cpp:1732: error: conversion from ‘const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*’ to non-scalar type ‘mlc::ls_id_index’ requested
public-ro/mlc/src/dutables.cpp:1738: error: conversion from ‘const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*’ to non-scalar type ‘mlc::ls_id_index’ requested
public-ro/mlc/src/dutables.cpp:1749: error: conversion from ‘const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*’ to non-scalar type ‘mlc::ls_id_index’ requested
public-ro/mlc/src/dutables.cpp:1760: error: conversion from ‘const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*’ to non-scalar type ‘mlc::ls_id_index’ requested
public-ro/mlc/src/dutables.cpp:1770: error: conversion from ‘const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*’ to non-scalar type ‘mlc::ls_id_index’ requested
public-ro/mlc/src/dutables.cpp: At global scope:
public-ro/mlc/src/dutables.cpp:2051: warning: extra ‘;’
make: *** dutables.o Error 1
řešení neznám. Stejnou chybu dostanu při kompilaci DU3 i DU4, které jsou na webu. Může někdo potvrdit, že je zkompiluje?

Při tvorbě Makefilu pro DÚ3 jsem ještě narazil na problém, že dutables.h includuje soubory, které v DU3 nejsou a objeví se až v DU4 a adresáři common. Zkopírování z DU4 sice pomůže, ale nepodařilo se mi to tam natahat bez XML.

Kód: Vybrat vše

#include "flat_icblock.hpp"
#include "labeled_icblock.hpp"
#include "uid_gen.hpp"
Jsem jediný, kdo na to narazil?

A jako bonus windowsová verze bizona v labu pochází z minulého tisíciletí, není tedy příliš překvapivé, že to s ní nefunguje.
May the source be with you!
Bud a Pest

Re: DU4 - nejde zkompilovat

Příspěvek od Bud a Pest »

Ahoj,

pre tych co neboli na prednaske, dnes aktualizovali projekt DU4 pretoze nefungovala, ale este stale je tam chyba, je potrebne do suboru du4.cpp pridat #include <stdint.h>.
Návštěvník

Re: DU4 - nejde zkompilovat

Příspěvek od Návštěvník »

ako mam pridat <stdint.h>, ked to je sucastou az VS2010 a ja mam iba VS2008?
(ps: skusil som ten subor stiahnut, a prilinkovat, ale aj tak to nepomohlo, takze includovat <stdint.h> nieje riesenie)
Návštěvník

Re: DU4 - nejde zkompilovat

Příspěvek od Návštěvník »

ahoj. nevedeli by ste mi niekto poradit?
vo VS2008 mi to nejde skompilovat. (projekt z minuleho roku). ma to nieco spolocne s tym, ze som opravil chyby, ktore boli sposobene BUGom v bisone.

napr:
%type <mlc::MlaskalLval> konstanta

bisonom mi to teda prejde.
lenze potom v kode:
block_consts : DUTOK_IDENTIFIER DUTOK_EQ konstanta DUTOK_SEMICOLON {
switch($3._tc) {

mi to hodi error:
Error 5 error C2274: 'function-style cast' : illegal as right side of '.' operator e:\Projects\VisualStudio2008\PrincipyPrekladacu09\du4\public-rw\SWI098\du4\du4g.y 126 mlc
Error 6 error C2228: left of '._tc' must have class/struct/union e:\Projects\VisualStudio2008\PrincipyPrekladacu09\du4\public-rw\SWI098\du4\du4g.y 126 mlc

a nechapem preco, ked konkretne $3 je typu mlc::MlaskalLval, co je struktura. nechapem co mu tam vadi.
neviete niekto preco zrazu projekt ktory minuly rok siel (so starym bisonom), tak po doplneni typov pre niektore pomenovane bloky, zrazu nejde vobec skompilovat? skusal som to aj v minulorocnom projekte, takze to nebude tohorocna chyba.
blabla
Matfyz(ák|ačka) level II
Příspěvky: 70
Registrován: 27. 1. 2010 23:14
Typ studia: Informatika Mgr.

Re: DU4 - nejde zkompilovat

Příspěvek od blabla »

budes to musiet prepracovat... ty si mi radil v DU4 vsak? a presne to tvoje riesenie sposobuje to co si tuna popisal. je to kvoli bisonu, podarilo sa mi zohnat staru verziu bisona a v nom to fici normalne, pri pouziti toho noveho 2.4.1 ti to ale robi presne to co si napisal.. myslim ze tam sposobuje problemy to ze tam je zadefinovany ten YYSTYPE, ale neviem to isto. ja som to riesil tak, ze som si v namespace mlc zadefinoval novy struct povedzme blabla a potom som to pouzil dalej:
struct MlaskalLval {
mlc::blabla bla;
}

pricom potom sa v du4g.y mozes odkazovat na tento typ ako
%type<bla> nejaky_neterminal

jendoduchsie riesenie som nenasiel...
blabla
Matfyz(ák|ačka) level II
Příspěvky: 70
Registrován: 27. 1. 2010 23:14
Typ studia: Informatika Mgr.

Re: DU4 - nejde zkompilovat

Příspěvek od blabla »

teda zabudol som dodat ze ten blabla struct bol vlastne skoro to iste ako MlaskalLval.. :) aspon tymto sposobom som teda mohol pouzivat neico podobne akoMlaskalLval
Návštěvník

Re: DU4 - nejde zkompilovat

Příspěvek od Návštěvník »

takze si vlastne iba "zaobalil" ten mlaskalLval?
Návštěvník

Re: DU4 - nejde zkompilovat

Příspěvek od Návštěvník »

tak som to vyriesil.
stacilo rollbacknut bison a flex na verzie odporucane na stranke predmetu, a zrazu vsetko funguje.
Odpovědět

Zpět na „SWI098 Principy překladačů“